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}
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.