基于xpath的Android应用程序测试脚本重用方法

Fei Song, Zhuoming Xu, F. Xu
{"title":"基于xpath的Android应用程序测试脚本重用方法","authors":"Fei Song, Zhuoming Xu, F. Xu","doi":"10.1109/WISA.2017.49","DOIUrl":null,"url":null,"abstract":"The version of an Android application (app) is updated frequently and rewriting test scripts for each version update is laborious and expensive, so reusing existing test scripts is a better choice. Although the app's business logic is relatively stable during the process of app version evolution, user interface (UI) control changes in the new version tend to cause the original test scripts to fail, which is the main problem in test script reuse. In this paper we address this problem by developing an XPath-based approach to reusing test scripts for Android apps in the case of changes in the locations, names, or property values of UI controls in the app. In our approach, the test scripts use XPath expressions to locate the UI controls. The approach first identifies failed test scripts and no longer valid XPath expressions by executing the original test scripts on the new version of the app. Next, it uses the invalid XPath expressions to find the difference between the two DOMs corresponding to a view in the changed page in the new version and a view in the original page in the previous version, respectively. Finally, it uses the DOM difference to repair the XPath expressions, thereby achieving the reuse of test scripts. We have implemented a prototype of the approach based on Robotium and used it to conduct experiments on two real-world Android apps. The results show that our approach can achieve a higher script reuse percent than Robotium.","PeriodicalId":204706,"journal":{"name":"2017 14th Web Information Systems and Applications Conference (WISA)","volume":"15 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":"{\"title\":\"An XPath-Based Approach to Reusing Test Scripts for Android Applications\",\"authors\":\"Fei Song, Zhuoming Xu, F. Xu\",\"doi\":\"10.1109/WISA.2017.49\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"The version of an Android application (app) is updated frequently and rewriting test scripts for each version update is laborious and expensive, so reusing existing test scripts is a better choice. Although the app's business logic is relatively stable during the process of app version evolution, user interface (UI) control changes in the new version tend to cause the original test scripts to fail, which is the main problem in test script reuse. In this paper we address this problem by developing an XPath-based approach to reusing test scripts for Android apps in the case of changes in the locations, names, or property values of UI controls in the app. In our approach, the test scripts use XPath expressions to locate the UI controls. The approach first identifies failed test scripts and no longer valid XPath expressions by executing the original test scripts on the new version of the app. Next, it uses the invalid XPath expressions to find the difference between the two DOMs corresponding to a view in the changed page in the new version and a view in the original page in the previous version, respectively. Finally, it uses the DOM difference to repair the XPath expressions, thereby achieving the reuse of test scripts. We have implemented a prototype of the approach based on Robotium and used it to conduct experiments on two real-world Android apps. The results show that our approach can achieve a higher script reuse percent than Robotium.\",\"PeriodicalId\":204706,\"journal\":{\"name\":\"2017 14th Web Information Systems and Applications Conference (WISA)\",\"volume\":\"15 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2017-11-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"3\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2017 14th Web Information Systems and Applications Conference (WISA)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/WISA.2017.49\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2017 14th Web Information Systems and Applications Conference (WISA)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/WISA.2017.49","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

摘要

Android应用程序(app)的版本经常更新,为每个版本更新重写测试脚本既费力又昂贵,因此重用现有的测试脚本是更好的选择。虽然在应用版本演变过程中,应用的业务逻辑相对稳定,但新版本中用户界面(UI)控制的变化往往会导致原始测试脚本失败,这是测试脚本重用的主要问题。在本文中,我们通过开发一种基于XPath的方法来解决这个问题,在应用程序中UI控件的位置、名称或属性值发生变化的情况下,为Android应用程序重用测试脚本。在我们的方法中,测试脚本使用XPath表达式来定位UI控件。该方法首先通过在新版本的应用程序上执行原始测试脚本来识别失败的测试脚本和不再有效的XPath表达式。接下来,它使用无效的XPath表达式来查找新版本中更改页面中的视图与前一版本中原始页面中的视图分别对应的两个dom之间的差异。最后,它使用DOM差异来修复XPath表达式,从而实现测试脚本的重用。我们已经基于Robotium实现了该方法的原型,并用它在两个真实的Android应用程序上进行实验。结果表明,我们的方法可以实现比Robotium更高的脚本重用率。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
An XPath-Based Approach to Reusing Test Scripts for Android Applications
The version of an Android application (app) is updated frequently and rewriting test scripts for each version update is laborious and expensive, so reusing existing test scripts is a better choice. Although the app's business logic is relatively stable during the process of app version evolution, user interface (UI) control changes in the new version tend to cause the original test scripts to fail, which is the main problem in test script reuse. In this paper we address this problem by developing an XPath-based approach to reusing test scripts for Android apps in the case of changes in the locations, names, or property values of UI controls in the app. In our approach, the test scripts use XPath expressions to locate the UI controls. The approach first identifies failed test scripts and no longer valid XPath expressions by executing the original test scripts on the new version of the app. Next, it uses the invalid XPath expressions to find the difference between the two DOMs corresponding to a view in the changed page in the new version and a view in the original page in the previous version, respectively. Finally, it uses the DOM difference to repair the XPath expressions, thereby achieving the reuse of test scripts. We have implemented a prototype of the approach based on Robotium and used it to conduct experiments on two real-world Android apps. The results show that our approach can achieve a higher script reuse percent than Robotium.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术官方微信