January 17, 2021
Hot Topics:

Android App Performance Testing: An End-to-end Approach

Android application performance tests need to follow an end-to-end application delivery model that tests for all the varying scenarios on each component involved. That way, android app developers can gain a true understanding of how their Android apps will perform on a given device as the end users would perceive them.

In a recent DevX article, we proposed such an end-to-end approach for mobile application performance testing. In this article we validate that approach for Android developers by will walking through an Android application performance test using a sample banking app.

Android App Performance Test Components

The Android app performance test involves the following components and tools.

Android Application

The sample Android app is a hybrid application for processing banking transactions. Hybrid mobile applications are installed on mobile devices just like native mobile apps but users can access them via either an installed app or the device browser. The aim is to test this application for performance and find different performance viewpoints.

Server Component

The server component (see details below) handles the business logic for the banking transactions initiated from either a mobile thick/thin client or a desktop Web browser.

  • Operating System: Windows Server 2000
  • JDK: 1.6
  • Web Server: Apache Tomcat
  • Database Server: MySQL

Network Emulator

A network emulator recreates a wide variety of network conditions such as latency, jitter, packet loss/error/reordering, and bandwidth restrictions, so that developers can simulate environments such as Wide Area Networks (WANs), Wireless LANs, GPRS, 3G, 2G, IP over Radio / Radio over IP (RoIP), Satellite or MPLS networks. The network emulator determines the traffic load generated by the application under different network conditions. We used Infosys WindTunnel, an in-house tool developed by Infosys Labs, for this performance test.

Load Generator

A load generator tool generates load on the application under test, and it will measure the load times. It allows configuration changes to ramp up the load, increase concurrent users, increase transactions per second, enable parameterization of the URLs, and name each URL. We used JMeter to recreate the load from different delivery modes for the sample application.

Android Device

We used both a high-end and a low-end device for testing to because performance can vary and we wanted to prove the importance of variability in device configurations on the same platform.

Performance Monitor

Perfmon is a performance monitoring tool that is mapped with windows. The required performance counters are configured before running the test. After you start the configured data collector set, it automatically collects the results data during the scenario run.

Android Debug Bridge

The Android Debug Bridge (adb), a tool that comes with the Android SDK, allows us to control and interface with our Android device. We used various adb commands to monitor the sample hybrid Android app.

  • adb shell top — Returns the CPU info for all the Process IDs (PID)
  • adb shell dumpsys meminfo <PID> — Returns the memory info for the particular Process ID
  • adb shell procrank — Returns the PSS, RSS, VSS and USS for all the process IDs (PID)
  • adb shell cat /proc/cpuinfo — Returns the processor information of the emulator
  • adb shell cat /proc/meminfo — Returns the memory Info for all the process IDs (PID)
  • adb logcat — Returns the log messages, including GC

Dalvik Debug Monitor Server

DDMS is an Android debugging tool that provides port-forwarding services, screen capture on the device, thread and heap information on the device, logcat, process, and radio state information, incoming call and SMS spoofing, location data spoofing, and more.

DDMS is integrated into Eclipse and is also shipped in the tools/ directory of the SDK. To launch the tool, follow these instructions.

  • From Eclipse: Click Window > Open Perspective > Other... > DDMS.
  • From the command line: Type ddms (or ./ddms on Mac/Linux) from the tools/ directory.

Originally published on https://www.developer.com.

Page 1 of 2

This article was originally published on June 1, 2012

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date