[论文解读] Automation of Android Applications Testing Using Machine Learning Activities Classification
本文提出ACAT,一种基于机器学习的框架,可将Android应用活动分类为预定义类型,以实现自动化、针对性的UI测试。通过利用活动结构的相似性,ACAT针对每种活动类型应用专用测试,相较于Android Monkey在检测逻辑错误方面表现更优——成功发现所有预设的缺陷以及一个已存在的逻辑缺陷,而Monkey则未发现任何缺陷。
Mobile applications are being used every day by more than half of the world's population to perform a great variety of tasks. With the increasingly widespread usage of these applications, the need arises for efficient techniques to test them. Many frameworks allow automating the process of application testing, however existing frameworks mainly rely on the application developer for providing testing scripts for each developed application, thus preventing reuse of these tests for similar applications. In this paper, we present a novel approach for the automation of testing Android applications by leveraging machine learning techniques and reusing popular test scenarios. We discuss and demonstrate the potential benefits of our approach in an empirical study where we show that our developed testing tool, based on the proposed approach, outperforms standard methods in realistic settings.
研究动机与目标
- 解决手动编写测试脚本在Android应用测试中效率低下且维护成本高的问题。
- 通过基于应用结构的自动测试生成,减少对开发人员提供的测试脚本的依赖。
- 通过活动特定的测试,提升对Android应用程序功能和逻辑错误的检测能力。
- 证明利用机器学习对应用活动进行分类并指导自动化测试的可行性。
- 通过识别共通的活动模式,实现在相似应用间复用测试场景。
提出的方法
- 训练一个机器学习模型,基于用户界面结构和行为,将Android应用活动分类为七种预定义类型之一。
- 使用Appium框架作为测试工具与Android设备之间用户界面交互的桥梁。
- 为TestProject自动化平台开发一个插件(ACAT),以集成分类与测试流程。
- 对每个已分类的活动应用预定义的、与活动类型相关的测试用例,以验证预期行为。
- 采用时间与事件受限的测试执行方式(2分钟或50,000次UI事件),以模拟真实测试环境。
- 为每个活动生成关于发现的崩溃和逻辑错误的详细报告。
实验结果
研究问题
- RQ1机器学习技术能否有效用于将Android应用活动分类为可复用的功能类型?
- RQ2活动分类是否能实现比通用事件驱动测试更有效、更精准的自动化测试?
- RQ3基于机器学习的方法在多大程度上能够检测到传统随机事件工具(如Android Monkey)所遗漏的逻辑错误?
- RQ4基于机器学习的测试方法在识别崩溃和逻辑缺陷方面,与标准工具相比性能如何?
- RQ5该框架能否扩展以支持更多活动类型,并减少对硬编码测试用例的依赖?
主要发现
- ACAT在实验中对三个未见过的活动实现了100%的分类准确率。
- ACAT成功发现测试应用中所有10个预设的逻辑错误,而Android Monkey未发现任何错误。
- ACAT在原始应用版本中识别出一个已存在的逻辑错误(发送收件人无效的邮件)。
- Android Monkey发现了一个实时崩溃,而ACAT未检测到,表明在崩溃与逻辑错误检测之间存在权衡。
- ACAT生成了关于发现错误的详细报告,证明其在功能缺陷检测中的实用性。
- 结果验证了将每个活动视为具有特定预期行为的独立实体的可行性,从而提升了测试的精确度。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。