Can You Mimic Me? Exploring the Use of Android Record & Replay Tools in Debugging

Zihe Song, S. M. Hasan Mansur, Ravishka Rathnasuriya, Yumna Fatima, Wei Yang, Kevin Moran, Wing Lam

Introduction

Android developers frequently encounter "heisenbugs"—elusive failures that are difficult to trigger consistently. While stack traces offer a snapshot of an application's state at the moment of a crash, they often fail to capture the specific sequence of user interactions that led to the failure. Record & Replay (R&R) tools were developed to bridge this gap, allowing developers to capture UI actions into a trace that can be re-executed for debugging.

However, most existing research has evaluated these tools using "happy path" user scenarios. This paper presents the first comprehensive empirical study on the effectiveness of Android R&R tools for actual bug reproduction, addressing the lack of knowledge regarding their performance in the messy, edge-case-heavy context of real-world debugging.

Methodology

The authors conducted a large-scale empirical study evaluating four state-of-the-art R&R tools, each representing a different technical approach:

  • ReplayKit: A command-line tool relying on standard Android SDK utilities.
  • RERAN: A lightweight tool that records low-level kernel events, such as precise coordinates and states.
  • SARA: A widget-based tool that utilizes dynamic instrumentation (Frida) to record and replay interactions.
  • V2S: A vision-based tool that translates screen recordings into replayable scripts using deep learning.

The study evaluated these tools across three distinct use cases: the manual recording of standard user scenarios, the manual recording of specific bug reports (both crashing and non-crashing), and the replaying of crashes discovered by Automated Input Generation (AIG) tools like Monkey, APE, and Humanoid.

Datasets

The evaluation utilized two prominent benchmarks in the Android testing community: Themis (for crashing bugs and AIG evaluation) and AndroR2 (for non-crashing functional failures). The final scope included 34 user scenarios across 17 apps, 90 non-crashing failures across 42 apps, and 31 crashing bugs across 17 apps.

Why Bugs are Harder to Replay

The study revealed that bugs are fundamentally more difficult to replay than standard user paths. The failure rate for replaying bugs (38–44%) is more than double that of standard user scenarios (17%). Several technical factors contribute to this discrepancy:

The "Action Interval" Problem

A primary cause of failure is timing. If a tool replays a click before a page has finished loading or a network request has returned, the trace breaks. The study found that tools using short, fixed intervals (approximately 0.5s) failed significantly more often than those using longer intervals (2s). This suggests that static timers are insufficient for the unpredictable latency associated with bug-triggering states.

Instrumentation Overhead

Tools like SARA, which rely on the Frida instrumentation toolkit, suffer from significant I/O overhead. This overhead often leads to "Record Timeouts" or, in some cases, causes the application to crash due to the tool's own resource consumption rather than the underlying bug being studied.

Vision-Based Fragility

Vision-based tools like V2S struggle with UI "flakiness." For instance, identifying white touch indicators against white backgrounds can lead to inaccurate script generation, rendering the replay useless for precise debugging.

Key Results and Findings

  • Failure Rates: 17% of user scenarios, 38% of non-crashing failures, and 44% of crashing bugs could not be reliably recorded and replayed.
  • Tool Performance: ReplayKit emerged as the most stable for simple scenarios (0% failure). Conversely, SARA exhibited the highest failure rates across the board—up to 60% for failures—due to its heavy instrumentation requirements.
  • Root Causes of Failure: The most frequent symptom of failure was "Click failed" (observed in 53 instances). These failures were typically rooted in short action intervals or incompatible APIs, such as the inability to handle screen rotations or long-press actions.
  • AIG Non-Determinism: A significant finding was that AIG tools like Monkey, APE, and Humanoid are often unable to reproduce the same crash twice, even when using the same random "seed." Monkey, APE, and Humanoid could only consistently reproduce detected bugs in 7, 6, and 2 out of 27 apps, respectively.

Limitations and Future Directions

The study identified several technical hurdles that must be addressed to make R&R tools viable for professional debugging:

  1. SDK Conflicts: Currently, getevent (used by R&R tools to monitor) and sendevent (used by AIG tools to inject actions) cannot function simultaneously on the same device, creating a bottleneck for automated workflows.
  2. Dynamic Waiting: Future R&R tools must move away from fixed sleep timers. Implementing dynamic "loading checks" to ensure the UI is ready before replaying the next action is essential for stability.
  3. Trace Reduction: For bugs detected by AIG, the authors recommend developing techniques to log all actions on the fly and then automatically "shrink" the trace to the minimal set of actions required to trigger the crash, making the logs more readable for developers.

In conclusion, while R&R tools show promise for simple user paths, their current reliability in actual debugging scenarios remains low. Improving timing mechanisms and reducing instrumentation overhead are critical steps toward making these tools indispensable for Android developers.

Summary updated

BibTeX
@inproceedings{song2025can,
  author = {Zihe Song and S. M. Hasan Mansur and Ravishka Rathnasuriya and Yumna Fatima and Wei Yang and Kevin Moran and Wing Lam},
  title = {{Can You Mimic Me? Exploring the Use of Android Record \& Replay Tools in Debugging}},
  booktitle = {MOBILESoft@ICSE},
  year = {2025},
  url = {https://openreview.net/forum?id=bxaR9FJMyF},
}
Figure