LLM引导的基于场景的GUI测试
LLM-Guided Scenario-based GUI Testing
AI总结:
本文提出LLM引导的基于场景的GUI测试框架ScenGen,通过多智能体协作模拟手工测试,提升测试与业务逻辑的相关性和完整性。
摘要:
移动应用GUI的保障变得日益重要,因为GUI是用户与应用之间交互的主要媒介。尽管已经开发了具有多种策略的自动化GUI测试方法,但这些方法与底层应用业务逻辑之间仍存在巨大差距。大多数现有方法侧重于一般性探索而非完成特定测试场景,经常遗漏关键功能。受将业务逻辑驱动的场景作为测试基本单元的手工测试启发,本文引入了一种利用大型语言模型(LLM)来理解GUI语义及与给定场景的上下文相关性的方法。基于此能力,我们提出了ScenGen,一个LLM引导的基于场景的GUI测试框架,采用多智能体协作来模拟和自动化手工测试阶段。具体而言,ScenGen集成了五个智能体:Observer、Decider、Executor、Supervisor和Recorder。Observer通过提取和结构化GUI组件与布局来感知应用GUI状态,并解释语义信息。这些信息被传递给Decider,后者在LLM指导下做出场景驱动决策,以识别目标组件并确定实现特定目标的操作。Executor执行这些操作,而Supervisor验证与预期场景完成情况的一致性,确保可追溯性和一致性。最后,Recorder将GUI操作记录到上下文记忆中,作为后续决策的知识库,并监控运行时错误。综合评估表明,ScenGen能有效生成由LLM协作引导的基于场景的GUI测试,实现与业务逻辑更高的相关性,并提高自动化GUI测试的完整性。
英文摘要:
The assurance of mobile app GUIs has become increasingly important, as the GUI serves as the primary medium of interaction between users and apps. Although numerous automated GUI testing approaches have been developed with diverse strategies, a substantial gap remains between these approaches and the underlying app business logic. Most existing approaches focus on general exploration rather than the completion of specific testing scenarios, often missing critical functionalities. Inspired by manual testing, which treats business logic-driven scenarios as the fundamental unit of testing, this paper introduces an approach that leverages large language models to comprehend GUI semantics and contextual relevance to given scenarios. Building on this capability, we propose ScenGen, an LLM-guided scenario-based GUI testing framework employing multi-agent collaboration to simulate and automate manual testing phases. Specifically, ScenGen integrates five agents: the Observer, Decider, Executor, Supervisor, and Recorder. The Observer perceives the app GUI state by extracting and structuring GUI widgets and layouts, interpreting semantic information. This is passed to the Decider, which makes scenario-driven decisions with LLM guidance to identify target widgets and determine actions toward fulfilling specific goals. The Executor performs these operations, while the Supervisor verifies alignment with intended scenario completion, ensuring traceability and consistency. Finally, the Recorder logs GUI operations into context memory as a knowledge base for subsequent decision-making and monitors runtime bugs. Comprehensive evaluations demonstrate that ScenGen effectively generates scenario-based GUI tests guided by LLM collaboration, achieving higher relevance to business logic and improving the completeness of automated GUI testing.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。