Monkey test ==== monkey test is used to check app Memory leakage and cpu usage, and monkeyapp

Source: Internet
Author: User

Monkey test ==== monkey test is used to check app Memory leakage and cpu usage, and monkeyapp

Monkey testing has been being studied recently. There are a lot of online materials, but they are all copied one by one. Few Original

I will sort out the app Memory leakage check:

References:

  • Monkey Test Strategy: https://testerhome.com/topics/597
  • Android Monkey test detailed introduction: http://www.jikexueyuan.com/course/1619.html
  • Monkey Summary: https://testerhome.com/topics/3517
  • Http://www.linuxidc.com/Linux/2014-03/97563.htm
  • Https://www.cnblogs.com/jinjiangongzuoshi/p/5203738.html

First, we will test the basic monkey. Refer to previous documents

A point we need to pay attention to when testing monkey.

Memory Detection

The memory detection is recorded using a batch processing script, which is recorded once every 5 seconds:

The script is as follows and saved as a bat file

@echo off &color 0a&setlocal enabledelayedexpansion&title %~n0::@mode con lines=18 cols=50set package1=com.xxxx.xxxxxadb shell dumpsys meminfo %package1% | findstr "Pss" > ./info_1.txt:startadb shell dumpsys meminfo %package1% | findstr "TOTAL" >> ./info_1.txtecho.echo.ping -n 5 127.1>nulgoto start

First, let's take a look at the basic commands and view the application MEMORY command: adb shell dumpsys meminfo (process name)

Here we get a lot of information, focusing on the following fields:

(1) Native/Dalvik Heap Information

Specifically, in the first and second rows above, it gives the memory allocation at the JNI and Java layers. If you find that this value keeps increasing, memory leakage may occur in the program.

(2) Total PSS Information

This value is the actual memory occupied by your application. With this information, you can easily identify which programs on your mobile phone occupy a large amount of memory.

So we run the above bat file. The data obtained is as follows:

In the three columns on the right, if the user event stream is executed for 0.1 million times and the value continues to grow, the memory may leak.

The first column on the left indicates the memory occupied by the app. For example, when four apps are opened, we can compare which program occupies the most memory. This data is used!

 

Cpu check:

The bat script is

@echo off &color 0a&setlocal enabledelayedexpansion&title %~n0::@mode con lines=18 cols=50set package1=com.xxxx.xxxxxadb shell top -n 1 | findstr "PID" > ./cupInfo_1.txt:startadb shell top -n 1 | findstr %package1% >> ./cupInfo_1.txtecho.echo.ping -n 5 127.1>nulgoto start

 

 

 

Adb shell top command reference document: http://blog.csdn.net/kittyboy0001/article/details/38562515

 

 

PID process idPR priority CPU % current instantaneous CPU usage S Process status: D = uninterruptible sleep status, R = running, S = sleep, T = tracking/stopping, Z = zombie process # Number of threads currently used by the THR program VSS Virtual Set Size Virtual memory consumption (including memory occupied by the Shared Library) RSS Resident Set Size the actual physical memory used (including the memory occupied by the shared library) PCY scheduling policy priority, SP_BACKGROUND/SP_FOREGROUNDUID the name of the user idName process of the process owner

 

* The best way is to create an Excel chart and list the comparison data

 

 

 

 

 

 

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.