一句话:AppFlow 利用机器学习识别界面与控件,自动合成鲁棒、可复用的 UI 测试,显著降低新应用测试成本。
UI 测试困难,手工测试昂贵易错,自动化测试编写维护成本高。AppFlow 用机器学习自动识别常见屏幕和控件,避免开发者编写脆弱逻辑;开发者可为某类应用主功能编写模块化测试库(如购物应用的“加入购物车”),AppFlow 再为新应用合成完整测试,提供低人工冒烟测试并支持定制。作者在 60 个购物与新闻应用、BBC 新闻和 JackThreads 案例及 15 人用户研究中评估。结果显示,AppFlow 能准确识别屏幕与控件,合成鲁棒可复用的测试,覆盖 JackThreads 46.6% 可自动化测试,将新应用测试工作量最多降低 90%,并发现 8 个 bug(7 个功能 bug)。
UI testing is known to be difficult, especially as today’s development cycles become faster. Manual UI testing is tedious, costly and error- prone. Automated UI tests are costly to write and maintain. This paper presents AppFlow, a system for synthesizing highly robust, highly reusable UI tests. It leverages machine learning to automatically recognize common screens and widgets, relieving developers from writing ad hoc, fragile logic to use them in tests. It enables developers to write a library of modular tests for the main functionality of an app category (e.g., an “add to cart” test for shopping apps). It can then quickly test a new app in the same category by synthesizing full tests from the modular ones in the library. By focusing on the main functionality, AppFlow provides “smoke testing” requiring little manual work. Optionally, developers can customize AppFlow by adding app-specific tests for completeness. We evaluated AppFlow on 60 popular apps in the shopping and the news category, two case studies on the BBC news app and the JackThreads shopping app, and a user-study of 15 subjects on the Wish shopping app. Results show that AppFlow accurately recognizes screens and widgets, synthesizes highly robust and reusable tests, covers 46.6% of all automatable tests for Jackthreads with the tests it synthesizes, and reduces the effort to test a new app by up to 90%. Interestingly, it found eight bugs in the evaluated apps, including seven functionality bugs, despite that they were publicly released and supposedly went through thorough testing.