Monitoring and analysis of mobile testing network based on fiddler plug-in development

Source: Internet
Author: User

I. Background and PURPOSE:

Due to the fact that the app front-end service is seldom concerned with the anomaly of the backend network interface, the client QA is often confined to the testing function when testing the project, which results in a coarse test granularity. Even in accordance with the checklist function point, the client QA to the backend interface coverage is difficult to clear grasp.

Fiddler is a common tool we use in client testing, often in HTTP capture, construction requests, and so on. Native fiddler plug-in, lack of packet size, network request length, interface access frequency, interface coverage and other dimensions for network request analysis, while providing the function of speed control, the following describes the development of custom Fiddler plug-in auxiliary app business testing.

Second, the principle of the realization of tools

First of all, to understand the Fiddler implementation of HTTP proxy request principle, facilitate our in-depth research. Fiddler implementation of the principle is to intercept the Windows Winnet interface, in the forwarding server request and response phase, can hook the parameters passed, to monitor and even modify the network packet capacity. As shown, Fiddler provides 4 interfaces, Autotamperrequestbefore,autotamperrequestafter,autotamperresponsebefore, Autotamperresponseafter.

We implement these four methods in our own plugins to meet our own testing needs. In the projects I encountered, we implemented the following functions.

1. Discover the network Request packet exception problem, for example, the interface packet size is too large, to help analyze the interface whether there is redundant data, thereby saving users to use the Internet traffic burden of the app.

2. Discover the network request time-out exception problem, for example, found that the interface access time is too large to help find the backend potential logic error.

3, the detection of network requests access frequency anomalies, for example, the app page caching mechanism is normal, whether the interface because the timing of the transmission is not caused by frequent sending.

4, the business test can analyze the interface coverage, guide the follow-up test focus, make the test point more complete, to avoid leakage test.

5, modify the request response delay, simulate a variety of speed, such as 2,3G Network, broken network, etc., to facilitate the testing of various network anomalies case.

Examples of the program are:

Three, the main function of the tool:

    1. Packet Size Analysis:

Packet Size tab Displays the size of the requested packet in descending order according to the host filtering results configured in Host.ini, and the network request packet that is used to parse the exception.

The two digits in front of the reset button correspond to the total amount of traffic requested and the total time taken during the test process;

Two Windows display the requested packet size and the number of requests in real time, and give the peak value;

2. Request time-Length analysis:

The filtered URLs are sorted in descending order of request time, and the request takes time between Clientbeginrequest and Clientdoneresponse. Judge the exception request based on the time spent on the network request.

3. Number of requests:

The number of requests is compared to the test execution process to analyze whether a request has been sent repeatedly.

4. Monitoring of the interface coverage:

Coverage tab needs to monitor the interface through the Coverurl.ini configuration, during the testing process, covering the interface, corresponding to the small square display fill, otherwise not filled. Real-time statistics on the coverage of the monitoring interface, as shown in the pie chart:

Through the interface coverage monitoring, you can know that the client QA in the test process to the back-end interface, especially the new interface coverage, the test coverage of the overall situation and checklist design to provide knowledge, client testing should pay attention to the new interface coverage.

5. Speed control

Set the value of the speed by dragging the sliders on the trackbar, which can be used to simulate different network environments:

For example, unlimited WiFi environment, 3G Network (40-500KB/S), 2G Network (8KB/S), broken network.

Unlimited:

Broken Network:

Using the network simulation, combined with the above 1-4 points function, convenient to test various network anomaly case.

Four, can also do more

The above functions are mainly focused on the interface data monitoring, in fact, we do not have to go further to achieve the interface data modification, which means that we have implemented a common mobile app test mock platform!

Reference documents:

1.Fiddler Development Official Doc Document:http://docs.telerik.com/fiddler/Extend-Fiddler/ExtendWithDotNet

For more dry foods, please pay attention to "Baidu MTC Academy" Http://mtc.baidu.com/academy/article

Monitoring and analysis of mobile testing network based on fiddler plug-in development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.