一句话:提出 InputBlaster,用 LLM 生成带变异规则的测试生成器,自动产生异常文本输入以检测移动应用崩溃。
移动应用中的文本输入是搜索、认证、消息等核心功能的重要交互通道,但某些特殊文本(如把字号设为 -18)会导致应用崩溃;要全面测试应用,就需要生成多样化的异常输入,而组合爆炸、高上下文敏感性与复杂约束关系使这一任务颇具挑战。本文提出 InputBlaster,将异常文本输入生成问题形式化为“生成一组测试生成器”的任务,每个生成器可在同一变异规则下批量产出异常文本输入。具体而言,它利用 LLM 同时生成测试生成器与作为推理链的变异规则,并采用上下文学习范式,用示例引导 LLM 以提升性能。作者在 31 个流行 Android 应用的 36 个文本输入控件及其崩溃缺陷上进行评估,结果显示其缺陷检出率达到 78%,比最佳基线高出 136%;此外将其与自动化 GUI 测试工具集成后,在真实应用中检测到 37 个未见过的新崩溃。
Mobile applications have become a ubiquitous part of our daily life, providing users with access to various services and utilities. Text input, as an important interaction channel between users and applications, plays an important role in core functionality such as search queries, authentication, messaging, etc. However, certain special text (e.g., -18 for Font Size) can cause the app to crash, and generating diversified unusual inputs for fully testing the app is highly demanded. Nevertheless, this is also challenging due to the combination of explosion dilemma, high context sensitivity, and complex constraint relations. This paper proposes InputBlaster which leverages the LLM to automatically generate unusual text inputs for mobile app crash detection. It formulates the unusual inputs generation problem as a task of producing a set of test generators, each of which can yield a batch of unusual text inputs under the same mutation rule. In detail, InputBlaster leverages LLM to produce the test generators together with the mutation rules serving as the reasoning chain, and utilizes the in-context learning schema to demonstrate the LLM with examples for boosting the performance. InputBlaster is evaluated on 36 text input widgets with cash bugs involving 31 popular Android apps, and results show that it achieves 78% bug detection rate, with 136% higher than the best baseline. Besides, we integrate it with the automated GUI testing tool and detect 37 unseen crashes in real-world apps.
@inproceedings{paperbot11415,
title = {Testing the Limits: Unusual Text Inputs Generation for Mobile App Crash Detection with Large Language Model},
author = {Zhe Liu and Chunyang Chen and Junjie Wang and Mengzhuo Chen and Boyu Wu and Zhilin Tian and Yuekai Huang and Jun Hu and Qing Wang},
booktitle = {ICSE},
year = {2024},
doi = {10.1145/3597503.3639118}
}