Advertisment

Non-functional requirements in mobile apps

author-image
CIOL Bureau
Updated On
New Update

BANGALORE, INDIA: On mobile devices, the battery is a scarce and valuable resource. On a mobile phone in particular, the battery should remain maximally available for the phone application i.e. for making and receiving phone calls. Your application may therefore fall by the wayside if it drains too much battery.

Advertisment

The definition of what constitutes 'too much' may vary depending on the nature of the application and the hardware capabilities of the platform it is running on. A good way to evaluate the battery usage characteristics is to evaluate your application against a 'control' application which is usually a 'well-known application' in its class. For example, if you write a universal IM client for Android, you may want to evaluate its battery usage against that of the Meebo, or Nimbuzz applications.

There are three main battery power tests that you must perform:

Normal use test: Start on a full battery and use the application for 6-12 hours and measure the battery level at the end of each ½ or 1 hour. You may use an automated testing tool to do this so as to keep the test running for the required time interval. This test will tell you how quickly your application drains the battery when in 'normal' use, with all the foreground and background features of the application running normally.

Idle run test: Turn off the screen lock and power saver modes on the device. Then start on a full battery and keep the application running on its main, home or dashboard screen as appropriate, and measure the battery level at ½ or 1 hour intervals. This test will measure the battery drain due to such things as intentional or unintentional automatic screen refreshes, and due to the background threads or services running in your application.

Advertisment

Screen lock test: Perform test (b) again but with the device screen in locked mode. This will allow you to test if your application is consuming any CPU and/or network resources (and hence the battery) when it's not viewable to the user. In this case, to avoid unnecessary battery drain, you should pause / stop any kind of screen activity such as automatic screen refreshes and also pause / stop background thread or services in this mode.

In each case, you may want to plot the battery level against time so as to get a quick visual indication of the overall trend. Perform the same tests for the 'control' application in order to see how your application's battery drain characteristics compare with that of the control application.

Note that two major sources of battery drain are CPU usage and network usage (such as polling the 3G, WiFi or the GPS radio at regular intervals). Finally ensure that no other application is running on the device while performing the battery tests and turn off the telephone feature so as to avoid receiving a call while the test is underway. If possible also turn off applications such as email and chat clients that tend to run in the background.

Click here to read more!

tech-news