让 LLM 成为测试专家:通过功能感知决策将类人交互引入移动 GUI 测试
Make LLM a Testing Expert: Bringing Human-like Interaction to Mobile GUI Testing via Functionality-aware Decisions
AI总结:
本文提出 GPTDroid 框架,将移动 GUI 测试转化为问答任务,让 LLM 与应用交互生成测试脚本,并引入功能感知记忆提示机制指导长期探索,在 93 个应用上测试覆盖率提升 32%,发现更多 bug 并识别出 53 个新 bug。
摘要:
自动化图形用户界面(GUI)测试在确保应用程序质量方面发挥着至关重要的作用,尤其是随着移动应用已成为我们日常生活不可或缺的一部分。尽管基于学习的技术因其生成类人交互的能力而在自动化 GUI 测试中日益普及,但它们仍存在一些局限性,如测试覆盖率低、泛化能力不足以及严重依赖训练数据。受 ChatGPT 等大型语言模型(LLMs)在自然语言理解和问答方面取得成功的启发,我们将移动 GUI 测试问题表述为问答(Q&A)任务。我们提出了 GPTDroid,让 LLM 通过将 GUI 页面信息传递给 LLM 来与移动应用进行对话,以生成测试脚本,并执行这些脚本以持续将应用反馈传递给 LLM,从而迭代整个过程。在此框架内,我们还引入了一种功能感知记忆提示机制,该机制赋予 LLM 保留整个过程的测试知识的能力,并进行基于功能的长期推理以指导探索。我们在来自 Google Play 的 93 个应用上对其进行了评估,结果表明它在活动覆盖率方面比最佳基线高出 32%,并以更快的速度检测出多 31% 的 bug。此外,GPTDroid 在 Google Play 上识别出 53 个新 bug,其中 35 个已被确认并修复。
英文摘要:
Automated Graphical User Interface (GUI) testing plays a crucial role in ensuring app quality, especially as mobile applications have become an integral part of our daily lives. Despite the growing popularity of learning-based techniques in automated GUI testing due to their ability to generate human-like interactions, they still suffer from several limitations, such as low testing coverage, inadequate generalization capabilities, and heavy reliance on training data. Inspired by the success of Large Language Models (LLMs) like ChatGPT in natural language understanding and question answering, we formulate the mobile GUI testing problem as a Q&A task. We propose GPTDroid, asking LLM to chat with the mobile apps by passing the GUI page information to LLM to elicit testing scripts, and executing them to keep passing the app feedback to LLM, iterating the whole process. Within this framework, we have also introduced a functionality-aware memory prompting mechanism that equips the LLM with the ability to retain testing knowledge of the whole process and conduct long-term, functionality-based reasoning to guide exploration. We evaluate it on 93 apps from Google Play and demonstrate that it outperforms the best baseline by 32% in activity coverage, and detects 31% more bugs at a faster rate. Moreover, GPTDroid identify 53 new bugs on Google Play, of which 35 have been confirmed and fixed.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。