与GPT-3对话实现零样本类人移动应用自动化GUI测试
Chatting with GPT-3 for Zero-Shot Human-Like Mobile Automated GUI Testing
AI总结:
提出GPTDroid,利用大语言模型将移动GUI测试转化为问答任务,通过迭代对话生成类人测试脚本,在86个应用上覆盖率提升32%,缺陷检测增加36%。
摘要:
移动应用对人们的日常生活不可或缺,自动化GUI(图形用户界面)测试被广泛用于应用质量保证。人们越来越关注使用基于学习的技术进行自动化GUI测试,旨在生成类人动作和交互。然而,测试覆盖率低、泛化能力弱以及对训练数据的严重依赖等局限性,使得迫切需要一种更有效的方法来生成类人动作以彻底测试移动应用。受大型语言模型(LLM)如GPT-3和ChatGPT在自然语言理解和问答方面成功的启发,我们将移动GUI测试问题表述为问答任务。我们提出GPTDroid,通过将GUI页面信息传递给LLM以引出测试脚本,并执行这些脚本以持续将应用反馈传递给LLM,从而迭代整个过程,让LLM与移动应用进行对话。在此过程中,我们提取GUI页面的静态上下文和迭代测试过程的动态上下文,设计提示以将这些信息输入LLM,并开发一个神经匹配网络来将LLM的输出解码为可执行步骤以运行应用。我们在Google Play上的86个应用上评估了GPTDroid,其活动覆盖率为71%,比最佳基线高出32%,并且比最佳基线检测出多36%的缺陷,速度更快。GPTDroid还在Google Play上检测到48个新缺陷,其中25个已被确认/修复。我们进一步总结了GPTDroid在卓越性能背后的能力,包括语义文本输入、复合动作、长而有意义的测试轨迹以及测试用例优先级排序。
英文摘要:
Mobile apps are indispensable for people's daily life, and automated GUI (Graphical User Interface) testing is widely used for app quality assurance. There is a growing interest in using learning-based techniques for automated GUI testing which aims at generating human-like actions and interactions. However, the limitations such as low testing coverage, weak generalization, and heavy reliance on training data, make an urgent need for a more effective approach to generate human-like actions to thoroughly test mobile apps. Inspired by the success of the Large Language Model (LLM), e.g., GPT-3 and 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 it, we extract the static context of the GUI page and the dynamic context of the iterative testing process, design prompts for inputting this information to LLM, and develop a neural matching network to decode the LLM's output into actionable steps to execute the app. We evaluate GPTDroid on 86 apps from Google Play, and its activity coverage is 71%, with 32% higher than the best baseline, and can detect 36% more bugs with faster speed than the best baseline. GPTDroid also detects 48 new bugs on the Google Play with 25 of them being confirmed/fixed. We further summarize the capabilities of GPTDroid behind the superior performance, including semantic text input, compound action, long meaningful test trace, and test case prioritization.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。