Skip to main content
QUICK REVIEW

[Paper Review] Target Directed Event Sequence Generation for Android Applications

Jiwei Yan, Tianyong Wu|arXiv (Cornell University)|Jul 12, 2016
Software Testing and Debugging TechniquesComputer Science23 references5 citations
TL;DR

This paper proposes LATTE, a dynamic model for Android GUI testing that captures view states, back stack behavior, and code-level labels to enable targeted test generation. By using state similarity to reduce explosion and linking events to code snippets via labels, LATTE generates shorter, high-coverage test sequences that effectively target specific code regions, outperforming random exploration in efficiency while matching state-of-the-art coverage.

ABSTRACT

Testing is a commonly used approach to ensure the quality of software, of which model-based testing is a hot topic to test GUI programs such as Android applications (apps). Existing approaches mainly either dynamically construct a model that only contains the GUI information, or build a model in the view of code that may fail to describe the changes of GUI widgets during runtime. Besides, most of these models do not support back stack that is a particular mechanism of Android. Therefore, this paper proposes a model LATTE that is constructed dynamically with consideration of the view information in the widgets as well as the back stack, to describe the transition between GUI widgets. We also propose a label set to link the elements of the LATTE model to program snippets. The user can define a subset of the label set as a target for the testing requirements that need to cover some specific parts of the code. To avoid the state explosion problem during model construction, we introduce a definition "state similarity" to balance the model accuracy and analysis cost. Based on this model, a target directed test generation method is presented to generate event sequences to effectively cover the target. The experiments on several real-world apps indicate that the generated test cases based on LATTE can reach a high coverage, and with the model we can generate the event sequences to cover a given target with short event sequences.

Motivation & Objective

  • To address the limitations of existing models in capturing runtime GUI changes and Android-specific mechanisms like the back stack.
  • To support targeted test generation by linking GUI transitions to specific code snippets via a label set.
  • To reduce state explosion during model construction using a state similarity metric that balances accuracy and performance.
  • To enable efficient, high-coverage test case generation for specific code regions in Android apps.
  • To provide a dynamic, code-agnostic model construction method that works directly on APK files without requiring source code.

Proposed method

  • Dynamically instrument the Android app to collect runtime GUI state, back stack information, and event-triggered code snippets.
  • Construct the LATTE model by representing each state as a tuple of view information, view status, and back stack state.
  • Define a label set to map specific code snippets to GUI transitions, enabling target-directed testing.
  • Apply a state similarity metric to merge semantically similar states and reduce model size and analysis cost.
  • Generate test sequences by traversing the LATTE model to reach paths that cover user-defined target labels.
  • Use a testing framework to execute the generated event sequences and validate coverage.

Experimental results

Research questions

  • RQ1How can a GUI model for Android apps be enhanced to capture dynamic view changes and back stack behavior during runtime?
  • RQ2How can GUI transitions be semantically linked to underlying code snippets to support targeted testing?
  • RQ3What mechanism can effectively reduce state explosion in dynamic model construction while preserving model accuracy?
  • RQ4Can a model-based test generation approach achieve comparable code coverage to random testing with significantly shorter test sequences?
  • RQ5To what extent can the proposed model support efficient, targeted test generation for specific code regions in real-world Android applications?

Key findings

  • The LATTE model successfully captures dynamic GUI states and back stack behavior, enabling more accurate representation of Android app execution than prior models.
  • The use of label sets allows precise targeting of specific code regions, enabling developers to focus testing on critical or newly modified code.
  • The state similarity metric effectively reduces model size and analysis cost without sacrificing coverage, mitigating the state explosion problem.
  • Test cases generated using LATTE achieve code coverage comparable to state-of-the-art tools like Monkey and Dynodroid, but with significantly shorter event sequences.
  • The approach demonstrates practical effectiveness on real-world Android applications, showing that targeted test generation is both feasible and efficient.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.