通过抽象与具体化实现 GUI 测试迁移
GUI Test Migration via Abstraction and Concretization
AI总结:
本文提出抽象-具体化迁移范式及 MACdroid 方法,通过从源测试用例提取通用测试逻辑并指导 LLM 生成目标应用 GUI 测试用例,在两个数据集上分别将目标功能测试成功率提升至 64% 和 75%,显著优于基线方法。
摘要:
GUI 测试迁移旨在生成包含事件和断言的测试用例,以测试目标应用的特定功能。现有的迁移方法通常专注于 widget-mapping 范式,即将源应用中的控件映射到目标应用。然而,由于不同的应用可能以不同的方式实现相同的功能,直接映射可能导致不完整或有缺陷的测试用例,从而显著影响目标功能测试的有效性以及迁移方法的实际适用性。在本文中,我们提出了一种新的迁移范式(即抽象-具体化范式),该范式首先抽象目标功能的测试逻辑,然后利用该逻辑生成具体的 GUI 测试用例。此外,我们介绍了 MACdroid,这是第一个基于该范式迁移 GUI 测试用例的方法。具体来说,我们提出了一种抽象技术,利用来自源应用中针对相同功能的源测试用例来提取该功能的通用测试逻辑。然后,我们提出了一种具体化技术,利用通用测试逻辑来指导 LLM 为目标应用生成相应的 GUI 测试用例(包括事件和断言)。我们在两个广泛使用的数据集(包括 31 个应用、34 个功能和 123 个测试用例)上评估了 MACdroid。在 FrUITeR 数据集上,MACdroid 生成的测试用例成功测试了 64% 的目标功能,比基线方法提高了 191%。在 Lin 数据集上,MACdroid 成功测试了 75% 的目标功能,比基线方法高出 42%。这些结果凸显了 MACdroid 在 GUI 测试迁移中的有效性。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。