Lune

ASE2022Top-tier venue

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

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.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

5 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Compatibility Issues in Deep Learning Systems: Problems and Opportunities cites 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 cites 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 cites 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 cites 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 cites Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Compatibility Issues in Deep Learning Systems: Problems and OpportunitiesJun Wang, Guanping Xiao, Shuai Zhang, Huashan Lei et al.FSE 2023 · 13 citations
  2. ReuNify: A Step Towards Whole Program Analysis for React Native Android AppsYonghui Liu, Xiao Chen, Pei Liu, John Grundy et al.ASE 2023 · 7 citations
  3. Navigating the Labyrinth: Path-Sensitive Unit Test Generation with Large Language ModelsDianshu Liao, Xin Yin, Shidong Pan, Chao Ni et al.ASE 2025 · 2 citations
  4. 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 et al.FSE 2025 · 1 citation
  5. Deployability-Centric Infrastructure-as-Code Generation: Fail, Learn, Refine, and Succeed through LLM-Empowered DevOps SimulationTianyi Zhang, Shidong Pan, Zejun Zhang, Zhenchang Xing et al.FSE 2026 · 1 citation

Builds on4

  1. API-Misuse Detection Driven by Fine-Grained API-Constraint Knowledge GraphXiaoxue Ren, Xinyuan Ye, Zhenchang Xing, Xin Xia et al.ASE 2020 · 62 citations
  2. JuCify: A Step Towards Android Code Unification for Enhanced Static AnalysisJordan Samhi, Jun Gao, Nadia Daoudi, Pierre Graux et al.ICSE 2022 · 43 citations
  3. Flaky test detection in Android via event order explorationZhen Dong, Abhishek Tiwari, Xiao Liang Yu, Abhik RoychoudhuryFSE 2021 · 25 citations
  4. Automatically detecting API-induced compatibility issues in Android apps: a comparative analysis (replicability study)Pei Liu, Yanjie Zhao, Haipeng Cai, Mattia Fazzini et al.ISSTA 2022 · 21 citations

Related papers

  1. Compatibility Issue Detection for Android Apps Based on Path-Sensitive Semantic AnalysisSen Yang, Sen Chen, Lingling Fan, Sihan Xu et al.ICSE 2023 · 12 citations
  2. How Android developers handle evolution-induced API compatibility issues: a large-scale studyHao Xia, Yuan Zhang, Yingtian Zhou, Xiaoting Chen et al.ICSE 2020 · 38 citations
  3. Characterizing and Detecting Configuration Compatibility Issues in Android AppsHuaxun Huang, Ming Wen, Lili Wei, Yepang Liu et al.ASE 2021 · 15 citations
  4. Towards Automatically Repairing Compatibility Issues in Published Android AppsYanjie Zhao, Li Li, Kui Liu, John C. GrundyICSE 2022 · 25 citations
  5. ComboDroid: generating high-quality test inputs for Android apps via use case combinationsJue Wang, Yanyan Jiang, Chang Xu, Chun Cao et al.ICSE 2020 · 61 citations
Dusk over the sea between two cliffs drawn in fine vertical lines