Mining Android API Usage to Generate Unit Test Cases for Pinpointing Compatibility Issues
Xiaoyu Sun, Xiao Chen, Yanjie Zhao, Pei Liu, John Grundy, Li Li
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Compatibility Issues in Deep Learning Systems: Problems and Opportunities 引用了 Automatically detecting API-induced compatibility issues in Android apps: a comparative analysis (replicability study)
- Why the Proof Fails in Different Versions of Theorem Provers: An Empirical Study of Compatibility Issues in Isabelle 引用了 Compatibility Issues in Deep Learning Systems: Problems and Opportunities
- Why the Proof Fails in Different Versions of Theorem Provers: An Empirical Study of Compatibility Issues in Isabelle 引用了 Automatically detecting API-induced compatibility issues in Android apps: a comparative analysis (replicability study)
- ReuNify: A Step Towards Whole Program Analysis for React Native Android Apps 引用了 JuCify: A Step Towards Android Code Unification for Enhanced Static Analysis
- Deployability-Centric Infrastructure-as-Code Generation: Fail, Learn, Refine, and Succeed through LLM-Empowered DevOps Simulation 引用了 Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language Models
引用它的顶会 Paper5
- Compatibility Issues in Deep Learning Systems: Problems and OpportunitiesJun Wang, Guanping Xiao, Shuai Zhang, Huashan Lei 等FSE 2023 · 13 次引用
- ReuNify: A Step Towards Whole Program Analysis for React Native Android AppsYonghui Liu, Xiao Chen, Pei Liu, John Grundy 等ASE 2023 · 7 次引用
- Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language ModelsDianshu Liao, Xin Yin, Shidong Pan, Chao Ni 等ASE 2025 · 2 次引用
- Why the Proof Fails in Different Versions of Theorem Provers: An Empirical Study of Compatibility Issues in IsabelleXiaokun Luan, David Sanán, Zhe Hou, Qiyuan Xu 等FSE 2025 · 1 次引用
- Deployability-Centric Infrastructure-as-Code Generation: Fail, Learn, Refine, and Succeed through LLM-Empowered DevOps SimulationTianyi Zhang, Shidong Pan, Zejun Zhang, Zhenchang Xing 等FSE 2026 · 1 次引用
它引用的 Paper4
- API-Misuse Detection Driven by Fine-Grained API-Constraint Knowledge GraphXiaoxue Ren, Xinyuan Ye, Zhenchang Xing, Xin Xia 等ASE 2020 · 62 次引用
- JuCify: A Step Towards Android Code Unification for Enhanced Static AnalysisJordan Samhi, Jun Gao, Nadia Daoudi, Pierre Graux 等ICSE 2022 · 43 次引用
- Flaky test detection in Android via event order explorationZhen Dong, Abhishek Tiwari, Xiao Liang Yu, Abhik RoychoudhuryFSE 2021 · 25 次引用
- Automatically detecting API-induced compatibility issues in Android apps: a comparative analysis (replicability study)Pei Liu, Yanjie Zhao, Haipeng Cai, Mattia Fazzini 等ISSTA 2022 · 21 次引用
相关 Paper
- Compatibility Issue Detection for Android Apps Based on Path-Sensitive Semantic AnalysisSen Yang, Sen Chen, Lingling Fan, Sihan Xu 等ICSE 2023 · 12 次引用
- How Android developers handle evolution-induced API compatibility issues: a large-scale studyHao Xia, Yuan Zhang, Yingtian Zhou, Xiaoting Chen 等ICSE 2020 · 38 次引用
- Characterizing and Detecting Configuration Compatibility Issues in Android AppsHuaxun Huang, Ming Wen, Lili Wei, Yepang Liu 等ASE 2021 · 15 次引用
- Towards Automatically Repairing Compatibility Issues in Published Android AppsYanjie Zhao, Li Li, Kui Liu, John C. GrundyICSE 2022 · 25 次引用
- ComboDroid: generating high-quality test inputs for Android apps via use case combinationsJue Wang, Yanyan Jiang, Chang Xu, Chun Cao 等ICSE 2020 · 61 次引用
