"Go" Android app performance test

Source: Internet
Author: User
Tags call back

The performance test simulates various normal, peak, and abnormal load conditions through automated test tools to test the system's performance indicators. And the performance of the app is getting more and more attention, let's introduce the performance test method of the app. However, the performance test is a reference value, and no matter what test method is impossible to accurately test the actual performance of the tested object, this should be clear beforehand.
One, memory leaks
Android Memory Crawl Steps
Preparation: The computer needs to install Android ADB and add the ADB directory to the system environment variable, through the Computer Command window to see the memory changes, and record the memory value
Steps:
A, ADB devices-l see if the phone device is connected, as shown in:

X


b, enter the phone Liunx core
The ADB root command allows the already rooted phone to enter the root state of the ADB.
The ADB shell command enters the phone's Linux kernel and the "#" appears to represent the root permission, and "$" appears on behalf of the normal user rights.

C, use the top command to view memory usage, such as:

Crawling specific process memory changes can be used with commands:
ADB shell top-d 1–n 4 | Find ' Process name '
-D Specify Refresh interval time
-n Specifies the number of refreshes after exiting
D, launch the app you want to view on your phone, such as crowdfunding (Com.subject.zhongchou). To view the usage of the content, the following commands are available:
ADB shell top–d 1–n 4 | Find "Com.subject.zhongchou"

To save the crawled content locally, you can use the following command:
ADB shell top-d 1-n 4 | Find ' Com.subject.zhongchou ' >>c:\users\58\desktop\log.txt
The contents of Log.txt are as follows:

We only need to record "RSS actually use memory" this column of data, draw him as a line chart, analyze the memory fluctuation state, is the red circle part of the value,.
Analysis of the Memory line graph: The general crawl each fetch 200-300 data, crawl 3-5 times, and then look at the memory fluctuations, in a certain range of fluctuations in the fluctuation to prove that the memory is not disclosed, if the memory value continues to grow, there is no drop phenomenon indicates that there may be a memory leak.
Second, whether there is a duplicate pull of resources
Test steps:
1. Open the fiddler and connect the phone to the fiddler.
A, make sure the phone and fiddler are in a network segment.
B, set the phone's proxy for your computer's IP, port number is: 8888
C, confirm.
2, empty the Fiddler crawl record, and then open the object to be detected, such as the crowdfunding web App.
3, copy all the resources fetched in the Fiddler (a page to intercede all resources) to Excel.
4. Sort by Excel to see if there are duplicates in the obtained resource.

Through this, we clearly see that the contents of the loop are duplicated, and we need to call back to development to find the reason for the repeated pull of resources.
Three, no cache/first screen total traffic
Test steps:
1, clear the phone corresponding software cache.
2, open fiddler, empty fiddler fetch record.
3. Open the App,fiddler to be tested to fetch the first screen loading information.
4. Select Fiddler to fetch all records in the record, and select the "Statistics" tab in the right-hand box. As shown in the following:

The flow in Fiddler is Bytes Sent + Bytes Received, which is two items in the accents circle.
5, calculate the sum of this traffic is not to meet the requirements, of course, this is the product standards, such as: 58 of the app's first screen traffic can not exceed 200K. If the requirement is not reached, find out why.
IV, grab packet check (JS/CSS) request header cannot take cookies
Cookies:
1, open fiddler, empty Fiddler Crawl record.
2, access to the app, through the fiddler crawl all Resources.
3. See if there are any cookies in the js/css.
As shown in JS without cookies:

If the cookie is shown as JS, does not meet the requirements:

Special Note:
Some statistics JS need cookie please with development and product communication, communication through after explain reason, can pass.

Five, the use of the Hkust Xun Fei itest
The ITest Performance testing tool is not only suitable for individual users, but also a professional mobile performance monitoring tool for Android testers. Support manual testing and automated testing of the two modes, it fills the blank of the mobile phone automation test, to practical and efficient for the purpose of recording the performance of specific applications, including CPU, memory, traffic, power and other information.
Let's look at how this tool is used:
1, download and install ITest, Baidu Mobile assistant, pea pod, etc. can be downloaded.
2. After the installation is complete, open the application as shown in:

X


3, click the "Add" button in the "Monitor app" column to add the apps you want to monitor, like the crowdfunding network, as shown in. By clicking the "Modify" button after "monitoring metrics", you can increase or decrease the monitoring metrics.

4, after adding a monitoring app, click "Start monitoring" to start monitoring your app. As shown in the following:

5, put itest in the background to travel, and then open the monitored programs, such as: Crowdfunding network, a series of actions we expect. After the operation is finished, open the ITest and click the Stop Monitoring button to end the monitoring operation.
6. View the monitoring results. Open the menu item in the upper-left corner of the app and select "Data Chart" to view the data movement we monitor. As shown in the following:

7. Toggle the button below to view the chart of each indicator, as shown in:
(1) CPU Utilization chart:

(2) Memory usage

(3) Meteor accumulation chart

(4) Power statistics
If the app you're trying to test is not very large, the power trend graph is not fluctuating and is not shown here.
8, Test and analysis
ITest can monitor the app's CPU, memory, traffic and power fluctuations, but there is no clear indicator, the use of how much is appropriate, how many are excellent. As long as the use rate is not too high, and now the performance of mobile phones are getting higher, this monitoring value is only a reference,
Of course, the product or the project manager can set an indicator, we test on the specified model. If exceeded, go to find the cause of exceeding the standard, optimize.
Six, summary
In this paper, we discuss the performance testing methods of several applications, itest performance testing tools, through which we can test and monitor the various performance parameters of the tested app. However, before testing, we have to test the Application object, test execution of the model to make a clear choice, because the performance of the implementation of the model of the impact of a relatively large. The performance of the mobile application is also related to the response time of the service or interface, so the performance of the backend is also very important. After we have defined our testing objectives, we can accurately analyze the results of the test and coordinate with the relevant personnel to optimize them.

Transfer from Http://blog.sina.cn/dpool/blog/s/blog_68f262210102w97c.html?vt=4&type=-1

"Go" Android app performance test

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.