TL;DR
Most automated mobile app testers wander through an app trying to click every button and visit every screen, hoping to stumble upon a crash. BugHunter flips this script by "standing on the shoulders of giants": it uses Retrieval-Augmented Generation (RAG) and Multimodal Large Language Models (MLLMs) to look up historical bug reports from similar apps and actively hunt down those same failure patterns in the app under test. Across 71 apps, BugHunter detects 60% more bugs than the best existing baseline—and it uncovered 49 brand-new crash bugs in popular Google Play apps.
What Problem Does This Paper Address?
Automated Graphical User Interface (GUI) testing is essential for catching crashes before users do. However, existing tools—whether random, model-based, reinforcement-learning-based, or even recent LLM-driven agents—share a fundamental blind spot: they optimize for coverage (visiting as many pages and code paths as possible) rather than bug-proneness.
Yet in software development, history repeats itself. Apps with similar features often share similar implementation patterns and, consequently, similar bugs (for example, follower-count glitches that have plagued TikTok, Instagram, Facebook, and Twitter alike). While some prior work has tried to learn from historical bug reports, those efforts required heavy manual effort to build app-specific knowledge graphs that don't generalize across different apps. BugHunter asks: Can we automatically learn from the vast pool of open-source bug reports on GitHub to guide testing toward likely bugs in any new app?
Methods
BugHunter combines static program analysis, a two-stage RAG pipeline, and an MLLM (gpt-4-vision-preview) across three modules:
- Bug Knowledge Base Construction (Offline, runs once): BugHunter crawls open-source Android apps and their GitHub issue reports. It extracts each app's README, declared activities (
AndroidManifest.xml), and Activity Transition Graph (ATG)—a map of how screens connect, built by analyzingintent()calls in the source code's Abstract Syntax Tree. An LLM standardizes each app's description, and BERT embeddings map each bug report to its starting activity in the ATG. - Similar Bug Retrieval (Per app): For a new app under test, BugHunter generates a standardized description and runs a two-stage retrieval process against the knowledge base: fast embedding-based filtering followed by a more precise cross-encoder re-ranking (using BCEmbedding). An LLM then builds a testing cognitive map, semantically aligning the retrieved apps' bug reports onto the target app's ATG.
- Bug-Augmented Path Generation (Testing loop): Using Android's
UIAutomator, BugHunter captures the current screen's view hierarchy and visually annotates actionable elements with numbered red bounding boxes. Because online bug reports are often messy or missing steps—and UI layouts differ across apps—BugHunter uses: - Local path planning: The MLLM adapts the retrieved bug steps to equivalent widgets on the current screen.
- Global path planning: Guided by the cognitive map and a memory log of tested pages and bugs, BugHunter systematically moves between activities without redundant backtracking.
Datasets
- Bug Knowledge Base: 131,581 bug reports from 1,259 open-source mobile apps (2018–2024).
- Effectiveness & Ablation Evaluation (RQ1 & RQ2): 71 apps with 121 confirmed crash bugs, combining 20 apps (34 bugs) from the existing Themis benchmark and 51 newly collected F-Droid apps (87 bugs, updated after May 2024, with no overlap with the knowledge base).
- Real-World Evaluation (RQ3): 237 popular apps from Google Play.
Key Insights and Ideas
- Targeted bug hunting beats pure coverage—and still gets better coverage: By following bug-prone paths from similar apps, BugHunter doesn't just find more bugs; it also achieves higher activity and code coverage than coverage-focused baselines.
- Cross-app bug reports are noisy, but MLLMs can bridge the gap: Simply replaying steps from another app fails miserably (test migration and bug replay tools achieved at most 16% recall). Giving an MLLM visual annotations, the app's ATG, and testing history allows it to infer functionally equivalent actions on unfamiliar UIs.
- Every piece of the pipeline matters: Ablation studies show that removing the cross-app bug reports drops recall by 51%, while removing similar-app retrieval or cross-encoder re-ranking drops recall by 50%.
Key Results
- Bug Detection: On the 71-app benchmark (60-minute runs), BugHunter achieved 64% recall (77/121 bugs), a 60% improvement over the strongest of 16 baselines (GPTDroid at 40% recall, 51 bugs). BugHunter also detected every bug found by the baselines.
- Speed & Coverage: BugHunter reached its peak bug count in ~32 minutes—43% faster than the best baseline (46 minutes)—while achieving 53% activity coverage and 52% code coverage (vs. GPTDroid's 51% and 47%).
- Real-World Impact: Across 237 Google Play apps, BugHunter found 93 crash bugs, including 49 previously unknown bugs in 45 apps. Of those 49, developers have already fixed 33 and confirmed 9 (with 7 pending and 0 rejected).
Limitations and Future Work
- App Representativeness: While tested on open-source and popular Google Play apps, niche app categories or unusual bug types may not be fully represented.
- LLM Data Overlap: Pre-trained LLMs may have seen some open-source bug reports during training; the authors mitigated this in their Google Play evaluation by selecting apps updated after May 2024.
- Future Directions: The authors plan to extend BugHunter beyond Android to web and desktop applications (a small-scale pilot on 10 iOS and 10 HarmonyOS apps showed 80% and 78% recall, respectively) and refine its path-planning for more complex app architectures.
Summary updated