paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Mining Android API Usage to Generate Unit Test Cases for Pinpointing Compatibility Issues

挖掘 Android API 使用以生成用于定位兼容性问题的单元测试用例
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 2/10 · 该论文研究 Android API 兼容性问题的单元测试生成,核心是程序间反向数据流分析,属于传统软件测试与程序分析。它不涉及 LLM/Agent、AI 辅助静态分析、浮点程序分析或贝叶斯程序分析,因此与用户当前研究画像的核心交叉方向匹配度很低。引用 17 inbox
Xiaoyu Sun, Xiao Chen, Yanjie Zhao, Pei Liu, John Grundy, Li Li
crossref: 2026-09-12

AI 速览

一句话:提出 JUnitTestGen,挖掘 Android API 使用并经过程间反向数据流分析生成单元测试,以定位兼容性问题。

Android 官方框架仅为不到 30% 的 API 提供测试用例,导致许多兼容性问题难以在开发期发现,应用可能在特定设备上崩溃。已有工作主要检测签名级兼容性问题(某 API 在特定版本中不存在),忽略了语义代码变更等其他重要类型。为此,作者提出 JUnitTestGen:在真实 Android 应用中定位 API 使用,并通过过程间反向数据流分析,生成最小可执行代码片段作为单元测试用例。在数千个真实 Android 应用上的实验表明,该工具能为 Android API 有效生成合法单元测试用例;这些用例有助于定位兼容性问题,包括涉及语义代码变更的问题。

问题
官方 Android 框架测试用例覆盖率低,已有自动检测方法只关注 API 签名存在性导致的兼容性问题,语义变更等兼容性问题缺乏检测手段。
方法
JUnitTestGen 挖掘真实 Android 应用中的 API 使用,执行过程间反向数据流分析,为 API 生成最小可执行单元测试用例。
评估
在数千个真实 Android 应用上评估生成有效单元测试用例的效果,并验证这些用例能否帮助定位包括语义代码变更在内的兼容性问题。
原文摘要(Abstract)

Despite being one of the largest and most popular projects, the official Android framework has only provided test cases for less than 30% of its APIs. Such a poor test case coverage rate has led to many compatibility issues that can cause apps to crash at runtime on specific Android devices, resulting in poor user experiences for both apps and the Android ecosystem. To mitigate this impact, various approaches have been proposed to automatically detect such compatibility issues. Unfortunately, these approaches have only focused on detecting signature-induced compatibility issues (i.e., a certain API does not exist in certain Android versions), leaving other equally important types of compatibility issues unresolved. In this work, we propose a novel prototype tool, JUnitTestGen, to fill this gap by mining existing Android API usage to generate unit test cases. After locating Android API usage in given real-world Android apps, JUnitTestGen performs inter-procedural backward data-flow analysis to generate a minimal executable code snippet (i.e., test case). Experimental results on thousands of real-world Android apps show that JUnitTestGen is effective in generating valid unit test cases for Android APIs. We show that these generated test cases are indeed helpful for pinpointing compatibility issues, including ones involving semantic code changes.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot7221,
  title = {Mining Android API Usage to Generate Unit Test Cases for Pinpointing Compatibility Issues},
  author = {Xiaoyu Sun and Xiao Chen and Yanjie Zhao and Pei Liu and John Grundy and Li Li},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3561151}
}