Thursday 21 July 2016

Performance Testing on Smart phone


We often hear performance testing in our software testing field. This was very confusing to me, but now it is a very interesting subject to me. Performance testing does not mean to find any bugs or issue at all instead of it checks software program's
  • Speed - Determines whether the application responds quickly
  • Scalability - Determines maximum user load the software application can handle.
  • Stability - Determines if the application is stable under varying loads


In today’s tech world the technology is improving day by day, as a result, most of us are using high performing smartphone that is capable of doing nearly everything that a computer can do. So here I’m going to discuss how to do performance testing of a mobile based application.
Mostly two types of mobile based application can be seen
  • Client-Server App - An application  that communicates with server
  • Stand Alone App - An application that doesn’t communicate with server
The performance of client-server app depends on the following parameter:
  • CPU usage
  • Memory usage
  • Power consumption / Battery usage
  • Server performance
And for Stand alone based app’s performance also depends on the same parameter except the server performance. Now today’s high-tech world, availability of CPU & Memory of any mobile is huge so we wouldn’t worry about that two parameters. So our main focus will be power consumption & Server performance. Now let’s see how to do that:


Power consumption / Battery usage: First check whether the targeted app is showing under battery usage section or not. If yes, then it is OK otherwise use GSam Battery Monitor like app to monitor your targeted app’s battery consumption. Now reset the battery usage and switch off the phone and charge it fully. Now use it as you normally use your mobile until you need recharge your mobile and check your targeted app’s battery consumption. Repeat this two or three times and you will get your answer.


Server Performance: To check server performance we need to create some virtual users that will simulate the request as if someone using the app and for that we need to know the request format / type. What kind of request is getting generated by app can be known only by recording that request and it can be easily done JMeter recording. Following are the steps to configure it:
  • Open a Test plan & Add a Thread group
  • Right click on the “Thread Group” and add a recording controller: Add -> Logic Controller -> Recording Controller
  • Next, select WorkBench and right click on it and add the recorder: Add -> Non-Test Elements -> HTTP(S) Test Script Recorder
  • Configure HTTP(S) Test Script Recorder: Under Test plan content select the Target Controller as Test Plan -> Thread Group -> Recording Controller
  • Click on Start Button on HTTP(S) Test Script Recorder page. That will generate a Root CA Certificate in your JMeter’s bin folder.
  • Now install this certificate to your targeted devices and configure it’s proxy server to your system’s IP address. Configuration step to mobile:
    • Send certificate to mobile and touch it, will be installed automatically
    • Go to device’s settings -> go to WIFI section -> modify the WIFI(either by long pressing to that WIFI or from menu option) -> checked the advance settings -> select proxy settings to MANUAL -> set host / IP address to your system’s IP address (for example: 192.168.0.212) -> Set your port 8080 (Can be changed from Global settings -> Port field in JMeter script recorder page) -> Save it.
Note: Your system and you mobile device should be into same LAN otherwise it will not work
  • Now open the targeted App in your mobile, JMeter will record your activity. You can check it live.
After recording is over filter it smartly and run it. Now add listener to your script to analyze the server performance in terms of throughput (Request processed by server) Response time.

Any comments, suggestions will be appreciated. Feel free to contact anytime. Thank you for your patience.


No comments:

Post a Comment