AI 中文总结
该研究提出新型控制流结构,结合深度优先搜索改进Android自动化测试工具Monkey,提升测试效率与界面覆盖率,推动更高效的自动化测试技术发展。
AI 中文摘要
移动应用测试通常依赖于模拟用户输入的工具,例如用于Android系统的Exerciser Monkey。以Exerciser Monkey为例,它会生成随机事件(如触摸、手势、导航键),让开发者了解应用在真实手机上被真实用户交互时的表现。然而,这类工具不具备底层应用结构的知识,仅能以随机或预定义的方式(如开发者设计的场景,这是一项耗时的任务)与应用交互,导致测试速度慢且难以发现bug。本文提出一种能够表示Android应用代码的新型控制流结构,涵盖所有交互元素。我们证明该结构可通过为Exerciser Monkey提供测试环境知识,提升其有效性(更高的覆盖率)和效率(消除重复/冗余测试)。我们对比了Exerciser Monkey与结合深度优先搜索控制流结构的新工具Monkey++所实现的界面覆盖率,结果显示,Exerciser Monkey的随机特性会生成测试速度慢且覆盖率低的测试套件,而深度优先搜索生成的测试套件速度快一个数量级,且能实现用户交互元素的全覆盖率。我们认为,本研究将推动更高效的Exerciser Monkey,以及更具针对性的基于搜索的Android自动化测试技术的发展。
英文摘要
Testing mobile applications often relies on tools, such as Exerciser Monkey for Android systems, that simulate user input. Exerciser Monkey, for example, generates random events (e.g., touches, gestures, navigational keys) that give developers a sense of what their application will do when deployed on real mobile phones with real users interacting with it. These tools, however, have no knowledge of the underlying applications' structures and only interact with them randomly or in a predefined manner (e.g., if developers designed scenarios, a labour-intensive task) -- making them slow and poor at finding bugs. In this paper, we propose a novel control flow structure able to represent the code of Android applications, including all the interactive elements. We show that our structure can increase the effectiveness (higher coverage) and efficiency (removing duplicate/redundant tests) of the Exerciser Monkey by giving it knowledge of the test environment. We compare the interface coverage achieved by the Exerciser Monkey with our new Monkey++ using a depth first search of our control flow structure and show that while the random nature of Exerciser Monkey creates slow test suites of poor coverage, the test suite created by a depth first search is one order of magnitude faster and achieves full coverage of the user interaction elements. We believe this research will lead to a more effective and efficient Exerciser Monkey, as well as better targeted search based techniques for automated Android testing.
Journal refInternational Conference on Software Testing, Verification and Validation Workshops (ICSTW), pp. 138-145. IEEE, 2021
DOI:10.1109/ICSTW52544.2021.00034