基于检索式大语言模型实现高成本效益的UI自动化测试:以微信为案例研究
Enabling Cost-Effective UI Automation Testing with Retrieval-Based LLMs: A Case Study in WeChat
AI总结:
针对工业级UI自动化测试的成本与知识局限问题,本研究提出结合RAG、机器学习与LLM的CAT框架,在微信数据集上实现90%测试成功率且成本仅0.34美元,已落地检测141个bug。
摘要:
UI自动化测试在保障移动应用质量方面发挥着关键作用。尽管机器学习技术生成这类测试的应用日益广泛,但它们仍面临诸多挑战,例如UI元素不匹配问题。大语言模型(Large Language Models, LLMs)的最新进展借助其语义理解能力解决了这些问题。然而,将这类模型应用于工业级应用测试仍存在显著差距,尤其是在成本优化和知识局限性方面。为解决这一问题,我们提出了CAT框架,通过结合机器学习、大语言模型与最佳实践,为工业应用生成高成本效益的UI自动化测试。给定任务描述后,CAT采用检索增强生成(Retrieval Augmented Generation, RAG)技术调取工业应用的使用示例作为少样本学习上下文,辅助大语言模型生成具体的操作序列。随后,CAT运用机器学习技术(以大语言模型作为补充优化器)来定位UI屏幕上的目标元素。我们在微信测试数据集上的评估验证了CAT的性能与成本效益:其UI自动化测试成功率达90%,仅花费0.34美元,表现优于现有最优方法。我们还将该方法集成到真实的微信测试平台中,实践证明它可检测141个漏洞,优化了开发人员的测试流程。
英文摘要:
UI automation tests play a crucial role in ensuring the quality of mobile applications. Despite the growing popularity of machine learning techniques to generate these tests, they still face several challenges, such as the mismatch of UI elements. The recent advances in Large Language Models (LLMs) have addressed these issues by leveraging their semantic understanding capabilities. However, a significant gap remains in applying these models to industrial-level app testing, particularly in terms of cost optimization and knowledge limitation. To address this, we introduce CAT to create cost-effective UI automation tests for industry apps by combining machine learning and LLMs with best practices. Given the task description, CAT employs Retrieval Augmented Generation (RAG) to source examples of industrial app usage as the few-shot learning context, assisting LLMs in generating the specific sequence of actions. CAT then employs machine learning techniques, with LLMs serving as a complementary optimizer, to map the target element on the UI screen. Our evaluations on the WeChat testing dataset demonstrate the CAT's performance and cost-effectiveness, achieving 90% UI automation with $0.34 cost, outperforming the state-of-the-art. We have also integrated our approach into the real-world WeChat testing platform, demonstrating its usefulness in detecting 141 bugs and enhancing the developers' testing process.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。