skip to main content
research-article
Open access

Standing on the Shoulders of Giants: Bug-Aware Automated GUI Testing via Retrieval Augmentation

Authors:
Mengzhuo Chen
Institute of Software at Chinese Academy of Sciences, Beijing, China
University of Chinese Academy of Sciences, Beijing, China
,
Zhe Liu
Institute of Software at Chinese Academy of Sciences, Beijing, China
,
Chunyang Chen
Technical University of Munich, Munich, Germany
,
Junjie Wang
Institute of Software at Chinese Academy of Sciences, Beijing, China
,
Boyu Wu
Institute of Software at Chinese Academy of Sciences, Beijing, China
University of Chinese Academy of Sciences, Beijing, China
,
Jun Hu
Institute of Software at Chinese Academy of Sciences, Beijing, China
,
Qing Wang
Institute of Software at Chinese Academy of Sciences, Beijing, China
Authors Info & Claims
Published: 19 June 2025 Publication History

Abstract

In software development, similar apps often encounter similar bugs due to shared functionalities and implementation methods. However, current automated GUI testing methods mainly focus on generating test scripts to cover more pages by analyzing the internal structure of the app, without targeted exploration of paths that may trigger bugs, resulting in low efficiency in bug discovery. Considering that a large number of bug reports on open source platforms can provide external knowledge for testing, this paper proposes BugHunter, a novel bug-aware automated GUI testing approach that generates exploration paths guided by bug reports from similar apps, utilizing a combination of Large Language Models (LLMs) and Retrieval-Augmented Generation (RAG). Instead of focusing solely on coverage, BugHunter dynamically adapts the testing process to target bug paths, thereby increasing bug detection efficiency. BugHunter first builds a high-quality bug knowledge base from historical bug reports. Then it retrieves relevant reports from this large bug knowledge base using a two-stage retrieval process, and generates test paths based on similar apps’ bug reports. BugHunter also introduces a local and global path-planning mechanism to handle differences in functionality and UI design across apps, and the ambiguous behavior or missing steps in the online bug reports. We evaluate BugHunter on 121 bugs across 71 apps and compare its performance against 16 state-of-the-art baselines. BugHunter achieves 60% improvement in bug detection over the best baseline, with comparable or higher coverage against the baselines. Furthermore, BugHunter successfully detects 49 new crash bugs in real-world apps from Google Play, with 33 bugs fixed, 9 confirmed, and 7 pending feedback.

Formats available

You can view the full content in the following formats:

References

[1]
2020. Android Debug Bridge (adb). https://developer.android.com/studio/command-line/adb
[2]
2022. Android. https://developer.android.google/topic/
[3]
2023. pyvbox. https://pypi.org/project/pyvbox/.
[4]
2024. facebook 0 followers glitch. https://www.reddit.com/r/facebook/comments/1b8szmc/follower_count_not_seen_on_facebook_profile_any/

Index Terms

  1. Standing on the Shoulders of Giants: Bug-Aware Automated GUI Testing via Retrieval Augmentation

    Recommendations

    Comments