Component-based modeling for Android application testing
Yatian Gao · e-scholar@UOIT (University of Ontario Institute of Technology) · 2017
The rising popularity of Android and the component-based structure of its apps have motivated the need for automated model-based testing techniques on Android plat- form. Prior researches have primarily focused on the GUI-based model of Android apps. GUI-based model only includes Activity targeting graphical user interfaces. It neglects other components such as Service and Broadcast Receiver in the Android Development Framework. Although the GUI-based model testing has achieved a good testing result targeting the graphical user interface, its effectiveness has been decreasing as Android applications become more complex in both functional behaviors and component-based structure. This phenomenon challenges the feasibility of currently existing model-based testing on Android platform. To address the challenges mentioned above, we propose a component-based approach of automated model generation for model-based testing on Android platform in this thesis. First, we extend the state definition in the model. Activity, Service and Broadcast Receiver are abstracted into the component-based model as states. Newly introduced states can depict the behaviors of a given app in a larger scope for better descriptive modeling and input generation. Second, we extend transition definition, and also propose a static mapping transition builder for transition construction across different kinds of components. Then the event sequence generator & cluster is proposed to generate proper test sequences for testing. The event cluster assists the input generation of the component-based model testing. Also, we present CamDroid, a tool implementing the proposed approach for An- droid apps testing. Lastly, our experiments have corroborated CamDroid's ability to build a model connecting components including Service, Activity and Broadcast Receiver. It can overcome the new challenges of Android apps in model-based testing. As a result, component-based model can achieve better performance in real model- based testing in terms of code coverage, comparing to the traditional GUI-based model testing.