Skip to main content
QUICK REVIEW

[Paper Review] DroidWalker: Generating Reproducible Test Cases via Automatic Exploration of Android Apps

Ziniu Hu, Yun Ma|arXiv (Cornell University)|Oct 24, 2017
Software Testing and Debugging TechniquesComputer Science11 references4 citations
TL;DR

DroidWalker is a dynamic-analysis tool that generates reproducible test cases for Android apps by building a dynamic-adaptive model to abstract app states with sufficient granularity. It enables precise re-execution of test cases to reproduce crashes and bugs, supporting regression testing and cross-environment validation.

ABSTRACT

Generating test cases through automatic app exploration is very useful for analyzing and testing Android apps. However, test cases generated by current app-exploration tools are not reproducible, i.e. when the generated test case is re-executed, the app cannot reach the same state as the explored one. As a result, app developers are not able to reproduce the failure or crash reported during the exploration, to conduct regression test after fixing the bug, or to execute the same test in different environments. In this paper, we present DroidWalker, a dynamic-analysis tool to generate reproducible test cases for Android apps. The key design of our tool is a dynamic-adaptive model that can abstract the app state in a proper granularity so every state in the model can be reached afterwards. Given an app under test, DroidWalker first explores the app to build the model. Then developers can select the state in the model to be reproduced. Finally, DroidWalker executes all the generated test cases and the app could reach exactly the same state as the explored one. We apply DroidWalker in three real usage scenarios to demonstrate its practical usage. The video of our tool is at https://youtu.be/ndUD8Gxs800.

Motivation & Objective

  • Address the critical lack of reproducibility in test cases generated by existing automatic Android app exploration tools.
  • Enable developers to reliably reproduce crashes and UI states for debugging and regression testing.
  • Support exploration of commercial Android apps with customizable monitoring and detection functions.
  • Provide a mechanism to generate shortest-path test sequences to target app states using BFS traversal.
  • Facilitate cross-environment testing by ensuring identical state re-entry across different execution contexts.

Proposed method

  • Construct a dynamic-adaptive model during app exploration that captures app states with appropriate granularity to tolerate minor UI changes.
  • Use breath-first search (BFS) to generate event sequences that reach target states in minimal steps.
  • Record event traces with semantic awareness to ensure correct widget targeting despite UI layout shifts.
  • Integrate customizable detection functions via plugin classes that monitor logs, exceptions, or specific behaviors during exploration.
  • Store and replay test cases using model-based state references, ensuring the same app state is reached upon re-execution.
  • Support re-execution of test cases on different devices or emulators by relying on model-defined state identifiers rather than absolute screen coordinates.

Experimental results

Research questions

  • RQ1Can a dynamic-adaptive model be constructed to enable reproducible test case generation in Android app exploration?
  • RQ2How can event sequences be generated to reliably reach a specific app state despite minor UI changes?
  • RQ3To what extent can DroidWalker achieve higher code coverage and explore commercial Android apps compared to existing model-based tools?
  • RQ4Can customized monitoring functions be effectively integrated into the exploration pipeline to detect specific defects or exceptions?
  • RQ5How effective is DroidWalker in reproducing crashes and enabling regression testing across different execution environments?

Key findings

  • DroidWalker successfully generates reproducible test cases by modeling app states with dynamic-adaptive granularity, enabling consistent re-execution across different environments.
  • The tool achieved higher code coverage than existing model-based exploration tools, as demonstrated in its ability to explore complex commercial apps like Fitbit.
  • During exploration of Fitbit, DroidWalker detected two critical exceptions: java.lang.UnsupportedOperationException and java.io.FileNotFoundException, both reproducible upon re-execution.
  • The tool enabled precise reproduction of the java.io.FileNotFoundException by navigating to UI state number 6, confirming the same crash occurred upon re-execution.
  • Custom detection functions, such as the ExceptionCollector class, were successfully implemented and used to monitor logcat output, enabling automated defect detection during exploration.
  • DroidWalker’s BFS-based test case generation produced shortest-path sequences to target states, ensuring efficient and deterministic state re-entry.

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.