用抽象-具体范式迁移GUI测试,提升跨应用测试有效性
GUI Test Migration via Abstraction and Concretization
- 先从源应用提取通用测试逻辑,再生成目标应用的具体测试
- 在FrUITeR上成功测试64%功能,比基线提升191%
- 适合自动化测试人员和移动应用开发团队使用
GUI测试迁移旨在为目标应用生成包含事件和断言的测试用例,以验证特定功能。现有方法多采用控件映射范式,直接将源应用的控件映射到目标应用,但不同应用实现相同功能的方式各异,导致测试用例不完整或含错,严重影响测试效果与迁移实用性。本文提出新的抽象-具体迁移范式:首先抽象目标功能的测试逻辑,再据此生成具体GUI测试用例。我们进一步提出MACdroid,首个基于该范式的测试迁移方法。其抽象技术利用源应用中针对相同功能的测试用例,提取通用测试逻辑;具体化技术则利用该逻辑指导LLM生成目标应用的测试用例(含事件与断言)。我们在两个常用数据集上评估,涵盖31个应用、34项功能、123个测试用例。在FrUITeR数据集上,MACdroid成功测试64%的目标功能,较基线提升191%;在Lin数据集上成功测试75%,优于基线42%。结果表明,MACdroid在GUI测试迁移中具有显著有效性。
原文摘要 · Abstract (English)
GUI test migration aims to produce test cases with events and assertions to test specific functionalities of a target app. Existing migration approaches typically focus on the widget-mapping paradigm that maps widgets from source apps to target apps. However, since different apps may implement the same functionality in different ways, direct mapping may result in incomplete or buggy test cases, thus significantly impacting the effectiveness of testing target functionality and the practical applicability of migration approaches. In this paper, we propose a new migration paradigm (i.e., the abstraction-concretization paradigm) that first abstracts the test logic for the target functionality and then utilizes this logic to generate the concrete GUI test case. Furthermore, we introduce MACdroid, the first approach that migrates GUI test cases based on this paradigm. Specifically, we propose an abstraction technique that utilizes source test cases from source apps targeting the same functionality to extract a general test logic for that functionality. Then, we propose a concretization technique that utilizes the general test logic to guide an LLM in generating the corresponding GUI test case (including events and assertions) for the target app. We evaluate MACdroid on two widely-used datasets (including 31 apps, 34 functionalities, and 123 test cases). On the FrUITeR dataset, the test cases generated by MACdroid successfully test 64% of the target functionalities, improving the baselines by 191%. On the Lin dataset, MACdroid successfully tests 75% of the target functionalities, outperforming the baselines by 42%. These results underscore the effectiveness of MACdroid in GUI test migration.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。