According to Gartner, Inc., the mobile phone/tablet Android operating system accounted for 52.5% of smartphone sales in the third quarter of 2011, more than doubling its market share from the third quarter of 2010. Moreover, in December 2011, the Android Market exceeded 10 billion app downloads with a growth rate of one billion app downloads per month..
These numbers show the great success of this platform and indicate the necessity for cost-effective approaches for Android app development. An important software engineering challenge with mobile application development is that of finding effective solutions for achieving non-functional qualities in mobile applications and defining suitable techniques and tools to support their testing.
Android application testing represents a challenging activity, with several open issues, specific problems, and questions. For example, most developers remain largely unfamiliar with the Android development platform, leaving their applications prone to new kinds of bugs. Although Android apps are developed using Java technologies, they differ from standard Java client-server applications and traditional event-based desktop applications.
The structure of Android apps centers instead around particular software components offered by the Android Development Framework, such as Activity, Service, Content Provider, etc., which require specific management rules and a particular lifecycle .
A description of typical bugs encountered in real Android applications shows that frequent bugs are due to incorrect management of the ‘Activity’ component lifecycle. This component provides crucial functions for the application’s user interface and reacts to events generated by users and other system components. Incorrect management of these events often results in wrong or unsatisfactory application behavior.
We present AndroidRipper, an automated technique implemented in a tool that tests Android apps via their Graphical User Interface (GUI). We leverage results of recent work on model-based GUI testing. Some of these models include Event-Sequence Graphs, Event-Interaction-Graphs, Event-Flow Graphs, and Finite State Machines. Testing techniques based on these models perform test generation as a post-model creation step.
The biggest obstacle to adopting these techniques for the Android platform is model development . While researchers have developed techniques to reverse engineer (or rip) some models from the subject system by fully or partially automated analysis techniques, fully automatic analysis remains challenging for Android GUIs.
AndroidRipper extends previous work on ripping. Its goal is not to develop a model of the app. Instead, it uses ripping to automatically and systematically traverse the app’s user interface, generating and executing test cases as new events are encountered. Test cases are composed of sequences of events “fireable” through the widgets of the app’s GUI. Test case generation is based on the automatic dynamic analysis of the GUI that is executed in order to find and fire events in the GUI.
Evaluated on an open-source Android app, our results show that our GUI-based test cases are able to detect severe, previously unknown, faults in the underlying code, and the structured exploration outperforms a random approach.
To read this external content in full, download the complete paper from the author archives online at the University of Maryland.