Android effective memory test for APP test

After the application implements new functions, before it is ready to be released, performance testing must be carried out to ensure that there are no performance problems. Memory usage is one of the performances that must be tested. Due to the complexity of memory composition, there is no simple and general method to find all memory problems. Sometimes because the problem is more obvious, the problem is really found, but for more mature software, it is not so easy to find the memory problem. Now, it is summarized as follows from the three aspects of memory test process, memory test method, and memory usage evaluation suggestions, hoping to improve the effectiveness of memory testing.

Android effective memory test for APP test

Memory test process

1) Code : Ensure that no redundant Log and debugging components are attached.

2) Test scenario : For a newly developed function, only the performance test of the function is required. Therefore, the test scenario includes test points such as before the function is started, running, and after the end; the other type is the overall performance, which examines common scenarios of the application and performance indicators under comprehensive usage. The test scenario should include standby after startup, switching to the background, executing main functions, and repeatedly executing various functions. In two scenarios, focus on:

① Contains the interface of picture display;
② The network transmits a large amount of data;
③ Scenarios that need to cache data.

3) Convert the scene into a use case : After selecting the test scene, design a use case according to the characteristics of the memory test, and compare the memory changes of the APP; convert the test scene into a script, run the pan-consonance function for a long time, and compare the memory changes before and after the operation to evaluate the memory of the test app.

4) Execution : Display the collected data in the form of graphics, and observe the fluctuation of memory.

5) Analysis : Focus on the following fields when analyzing memory:

The Heap of Native/Dalvik shows the memory allocation of the JNI layer and the Java layer respectively. If this value keeps increasing, it means that the program may have a memory leak; the PSS information of Total represents the actual memory size occupied by the application. It can be used to identify which programs in the mobile phone occupy a relatively large amount of memory
.

Suggestions for judging memory usage

When performing performance evaluation through performance monitoring tools, the results obtained do not know whether the fluctuation of memory CPU is within expectations, and do not know how to evaluate it. After understanding, the following aspects can be considered:

1) First compare with the previous version with this function and competing products to get the memory difference

For example, evaluate the memory usage of each version of an APP and compare it with previous versions. It will also compare the memory consumption of competitors, and the memory usage of this version can be judged intuitively through the difference in memory.

2) If the previous version and competing products do not have this function, the memory consumed by the basic functions of the application can be used as a reference

3) Whether there is a memory leak

The method to judge whether the memory leaks is: whether there is an application crash caused by insufficient memory during the APP test process; whether there is a continuous increase in the memory. For the memory usage in the active case of Panconsonance in the above figure, it can be analyzed from the perspective of whether there is a memory leak.

4) Whether the peak value of memory is within the maximum allowed by a single application

For the maximum value, please refer to: the hardware configuration of the mobile phone; the maximum value allowed by the system; the peak value compared to similar applications. You can see the size of the mobile phone memory occupied by the application in the settings of the mobile phone, application manager, and application information. If the peak memory of a function is smaller than the memory occupied by the application, it is basically in line with expectations.

If it is helpful to you, please like and collect it to give the author an encouragement. It is also convenient for you to quickly find it next time.

If you don’t understand, please consult the small card below. The blogger also hopes to learn and progress with like-minded testers

At the right age, choose the right position, and try to give full play to your own advantages.

My road of automated test development is inseparable from the plan of each stage along the way, because I like planning and summarizing,

Test and develop video tutorials, study notes and receive portals! ! !

Guess you like

Origin blog.csdn.net/m0_59868866/article/details/131810581