一句话:通过记忆历次测试中的事件-活动转移知识并借助强化学习引导,实现可复用的 Android GUI 自动化测试。
本文面向 Android 应用的持续测试场景,提出一种可复用的自动化基于模型的 GUI 测试技术,以加速测试周期。其核心洞察是:历次测试运行中积累的事件-活动转移知识(即执行哪些事件可以到达哪些活动)对于指导后续测试快速覆盖应用主要功能具有重要价值。为此,作者提出(1)一个概率模型,用于在测试过程中记忆并利用这些知识;(2)一种基于模型的引导式测试策略,并用强化学习算法加以增强。该技术实现为自动化测试工具 Fastbot2。作者在两个流行的工业级应用(安装量达数十亿的抖音与今日头条)上进行评估,结果表明在持续测试情境下,Fastbot2 在活动覆盖率和故障检测方面均优于当前最先进的测试工具 Monkey、Ape 与 Stoat。Fastbot2 已在字节跳动的 CI 流水线中部署近两年,开发者修复的崩溃 bug 中有 50.8% 由 Fastbot2 报告,显著提升了应用质量,并已开源。
We introduce a reusable automated model-based GUI testing technique for Android apps to accelerate the testing cycle. Our key insight is that the knowledge of event-activity transitions from the previous testing runs, i.e., executing which events can reach which activities, is valuable for guiding the follow-up testing runs to quickly cover major app functionalities. To this end, we propose (1) a probabilistic model to memorize and leverage this knowledge during testing, and (2) design a model-based guided testing strategy (enhanced by a reinforcement learning algorithm). We implemented our technique as an automated testing tool named Fastbot2. The evaluation on two popular industrial apps (with billions of user installations), Douyin and Toutiao, shows that Fastbot2 outperforms the state-of-the-art testing tools (Monkey, Ape and Stoat) in both activity coverage and fault detection in the context of continuous testing. To date, Fastbot2 has been deployed in the CI pipeline at ByteDance for nearly two years, and 50.8% of the developer-fixed crash bugs were reported by Fastbot2, which significantly improves app quality. Fastbot2 has been made publicly available to benefit the community at: https://github.com/bytedance/Fastbot_Android.
@inproceedings{paperbot7242,
title = {Fastbot2: Reusable Automated Model-based GUI Testing for Android Enhanced by Reinforcement Learning},
author = {Zhengwei Lv and Chao Peng and Zhao Zhang and Ting Su and Kai Liu and Ping Yang},
booktitle = {ASE},
year = {2022},
doi = {10.1145/3551349.3559505}
}