Temac:用于自动化Web GUI测试的多智能体协作
ResTest: Targeted Coverage of Residual Not-Covered Code Using Large Language Models for Web GUI Testing
AI总结:
本文提出Temac,一种基于LLM多智能体协作的自动化Web GUI测试方法,通过构建知识库并引导智能体执行未覆盖功能,显著提升了代码覆盖率并发现了大量真实故障。
摘要:
Web应用程序的质量保证至关重要,因为Web应用程序在人们的日常生活中扮演着不可或缺的角色。为了降低人工成本,自动化Web GUI测试(AWGT)被广泛采用,它通过点击和文本输入等GUI操作来探索Web应用程序。然而,这些方法在生成能够覆盖复杂功能的连续且有意义的动作序列方面面临局限性。最近的研究将大型语言模型(LLM)引入GUI测试。然而,这些方法面临诸多挑战,包括LLM效率低下、Web应用程序上下文高度复杂,以及LLM在执行GUI任务时成功率较低。为了应对这些挑战,本文提出了Temac,这是一种利用基于LLM的多智能体协作来增强AWGT以提高代码覆盖率的方法。Temac的提出源于我们的洞察:LLM能够增强AWGT以执行复杂功能,而在AWGT过程中发现的信息反过来可以作为领域知识提供,以改进基于LLM的任务执行。具体而言,给定一个Web应用程序,Temac首先运行现有方法来广泛探索应用程序状态。当测试覆盖率停滞不前时,Temac随后采用基于LLM的智能体总结收集到的信息以形成知识库,并推断出尚未覆盖的功能。在此知识库的指导下,Temac最终使用专门的基于LLM的智能体来定位并执行这些尚未覆盖的功能,从而到达现有方法所探索范围之外的更深层次状态。我们的评估结果表明,在六个复杂的开源Web应用程序上,Temac的平均代码覆盖率比最先进的方法高出12.5%至60.3%,同时在前20个真实世界的Web应用程序中揭示了445个独特的故障。这些结果有力地证明了Temac的有效性和广泛适用性。
英文摘要:
Automated web GUI testing (AWGT) approaches explore web applications through GUI actions to achieve code coverage. However, existing approaches, whether random-based, model-based, or reinforcement-learning-based, often struggle to generate continuous and semantically meaningful action sequences for testing complex functionalities, limiting their achievable code coverage. Recent LLM-based approaches partially alleviate this problem but still fall short due to limited capability in inferring testable functionalities and low success rates in executing tasks on complex web applications. In this paper, we propose ResTest, a complementary approach that uses coverage-report-guided LLMs to target residual not-covered code left by existing AWGT approaches. ResTest first runs an existing AWGT approach to broadly explore the application while constructing a state transition graph with summarized information. Once coverage plateaus, ResTest employs an LLM to infer not-covered functionalities based on the state transition graph and coverage report, and then utilizes a specialized LLM-driven GUI agent to execute these functionalities in a targeted manner. Our evaluation on ten open-source web applications shows that ResTest improves three categories of AWGT approaches by 17.52\% to 24.36\% in average code coverage. Ablation studies further confirm the sustained coverage improvement capability and the contribution of each component.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。