Breaking Waiting: Accelerating Android GUI Testing via Widget Readiness Analysis
Xinrui Li, Xin Yin, Chao Ni, Xiaohua Xin, Carolyn Sun, Jue Wang, Xiaohu YangAutomated GUI testing for Android applications faces a challenge: determining when to execute test actions during interface rendering. Common approaches either use fixed delays between events or wait for complete GUI rendering, resulting in a trade-off between test reliability and efficiency. Fixed short waits cause flaky tests when elements are not ready, while conservative approaches waste testing time waiting for irrelevant widgets. To address this limitation, we present TurboDroid, a technique that detects widget-level readiness through method dependency analysis. TurboDroid identifies methods that affect widget rendering through static analysis, then monitors their execution alongside dynamic dependencies during testing. This enables a widget-specific “test-when-ready” approach that executes actions as soon as the target widget is determined to be ready. TurboDroid combines: (1) static analysis to identify dependencies between methods and UI elements, (2) runtime monitoring to detect widget readiness based on these dependencies, and (3) a specialized event dispatching mechanism for partially rendered GUIs. Experiments on real-world Android applications show that TurboDroid outperforms the evaluated state-of-the-art baselines. TurboDroid accelerates bug reproduction by 17.4% and detects 26 more crashes (83 vs. 57), while achieving higher activity coverage, greater code coverage, and broader GUI state exploration, with all improvements being statistically significant.