基于 LLM 的图形用户界面测试迁移的抽象和具体化

Yakun Zhang, Chen Liu, Xiaofei Xie, Yun Lin, Jin Song Dong, Dan Hao, Lu Zhang
{"title":"基于 LLM 的图形用户界面测试迁移的抽象和具体化","authors":"Yakun Zhang, Chen Liu, Xiaofei Xie, Yun Lin, Jin Song Dong, Dan Hao, Lu Zhang","doi":"arxiv-2409.05028","DOIUrl":null,"url":null,"abstract":"GUI test migration aims to produce test cases with events and assertions to\ntest specific functionalities of a target app. Existing migration approaches\ntypically focus on the widget-mapping paradigm that maps widgets from source\napps to target apps. However, since different apps may implement the same\nfunctionality in different ways, direct mapping may result in incomplete or\nbuggy test cases, thus significantly impacting the effectiveness of testing\ntarget functionality and the practical applicability. In this paper, we propose a new migration paradigm (i.e.,\nabstraction-concretization paradigm) that first abstracts the test logic for\nthe target functionality and then utilizes this logic to generate the concrete\nGUI test case. Furthermore, we introduce MACdroid, the first approach that\nmigrates GUI test cases based on this paradigm. Specifically, we propose an\nabstraction technique that utilizes source test cases from source apps\ntargeting the same functionality to extract a general test logic for that\nfunctionality. Then, we propose a concretization technique that utilizes the\ngeneral test logic to guide an LLM in generating the corresponding GUI test\ncase (including events and assertions) for the target app. We evaluate MACdroid\non two widely-used datasets (including 31 apps, 34 functionalities, and 123\ntest cases). On the FrUITeR dataset, the test cases generated by MACdroid\nsuccessfully test 64% of the target functionalities, improving the baselines by\n191%. On the Lin dataset, MACdroid successfully tests 75% of the target\nfunctionalities, outperforming the baselines by 42%. These results underscore\nthe effectiveness of MACdroid in GUI test migration.","PeriodicalId":501278,"journal":{"name":"arXiv - CS - Software Engineering","volume":"10 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"LLM-based Abstraction and Concretization for GUI Test Migration\",\"authors\":\"Yakun Zhang, Chen Liu, Xiaofei Xie, Yun Lin, Jin Song Dong, Dan Hao, Lu Zhang\",\"doi\":\"arxiv-2409.05028\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"GUI test migration aims to produce test cases with events and assertions to\\ntest specific functionalities of a target app. Existing migration approaches\\ntypically focus on the widget-mapping paradigm that maps widgets from source\\napps to target apps. However, since different apps may implement the same\\nfunctionality in different ways, direct mapping may result in incomplete or\\nbuggy test cases, thus significantly impacting the effectiveness of testing\\ntarget functionality and the practical applicability. In this paper, we propose a new migration paradigm (i.e.,\\nabstraction-concretization paradigm) that first abstracts the test logic for\\nthe target functionality and then utilizes this logic to generate the concrete\\nGUI test case. Furthermore, we introduce MACdroid, the first approach that\\nmigrates GUI test cases based on this paradigm. Specifically, we propose an\\nabstraction technique that utilizes source test cases from source apps\\ntargeting the same functionality to extract a general test logic for that\\nfunctionality. Then, we propose a concretization technique that utilizes the\\ngeneral test logic to guide an LLM in generating the corresponding GUI test\\ncase (including events and assertions) for the target app. We evaluate MACdroid\\non two widely-used datasets (including 31 apps, 34 functionalities, and 123\\ntest cases). On the FrUITeR dataset, the test cases generated by MACdroid\\nsuccessfully test 64% of the target functionalities, improving the baselines by\\n191%. On the Lin dataset, MACdroid successfully tests 75% of the target\\nfunctionalities, outperforming the baselines by 42%. These results underscore\\nthe effectiveness of MACdroid in GUI test migration.\",\"PeriodicalId\":501278,\"journal\":{\"name\":\"arXiv - CS - Software Engineering\",\"volume\":\"10 1\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-09-08\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"arXiv - CS - Software Engineering\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/arxiv-2409.05028\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Software Engineering","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.05028","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

图形用户界面测试迁移的目的是生成带有事件和断言的测试用例,以测试目标应用程序的特定功能。现有的移植方法通常侧重于部件映射范例,将源应用程序中的部件映射到目标应用程序中。然而,由于不同的应用程序可能以不同的方式实现相同的功能,直接映射可能会导致测试用例不完整或不准确,从而严重影响目标功能测试的有效性和实际应用性。在本文中,我们提出了一种新的移植范式(即抽象-具体化范式),首先抽象出目标功能的测试逻辑,然后利用该逻辑生成具体的图形用户界面测试用例。此外,我们还介绍了 MACdroid,这是第一种基于此范例迁移图形用户界面测试用例的方法。具体来说,我们提出了一种抽象技术,利用源应用程序中针对相同功能的源测试用例来提取该功能的通用测试逻辑。然后,我们提出一种具体化技术,利用通用测试逻辑指导 LLM 为目标应用程序生成相应的 GUI 测试用例(包括事件和断言)。我们在两个广泛使用的数据集(包括 31 个应用程序、34 种功能和 123 个测试用例)上对 MACdroid 进行了评估。在 FrUITeR 数据集上,MACdroids 生成的测试用例成功测试了 64% 的目标功能,比基线提高了 191%。在 Lin 数据集上,MACdroid 成功测试了 75% 的目标功能,比基线高出 42%。这些结果凸显了 MACdroid 在图形用户界面测试迁移中的有效性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
LLM-based Abstraction and Concretization for GUI Test Migration
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. In this paper, we propose a new migration paradigm (i.e., 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.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信