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

被引:0
|
作者
Sun, Xiaoyu [1 ]
Chen, Xiao [1 ]
Zhao, Yanjie [1 ]
Liu, Pei [1 ]
Grundy, John [1 ]
Li, Li [1 ]
机构
[1] Monash Univ, Clayton, Vic, Australia
基金
澳大利亚研究理事会;
关键词
D O I
10.1145/3551349.3561151
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
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.
引用
收藏
页数:13
相关论文
共 17 条
  • [1] Mining unit test cases to synthesize API usage examples
    Ghafari, Mohammad
    Rubinov, Konstantin
    Pourhashem K, Mohammad Mehdi
    JOURNAL OF SOFTWARE-EVOLUTION AND PROCESS, 2017, 29 (12)
  • [2] Detecting Android API Compatibility Issues With API Differences
    Mahmud, Tarek
    Che, Meiru
    Yang, Guowei
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2023, 49 (07) : 3857 - 3871
  • [3] Mining usage patterns for the Android API
    Borges, Hudson S.
    Valente, Marco Tulio
    PEERJ COMPUTER SCIENCE, 2015, 2015 (07)
  • [4] Android API Field Evolution and Its Induced Compatibility Issues
    Mahmud, Tarek
    Che, Meiru
    Yang, Guowei
    PROCEEDINGS OF THE16TH ACM/IEEE INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING AND MEASUREMENT, ESEM 2022, 2022, : 34 - 44
  • [5] An empirical study on compatibility issues in Android API field evolution
    Mahmud, Tarek
    Che, Meiru
    Yang, Guowei
    INFORMATION AND SOFTWARE TECHNOLOGY, 2024, 175
  • [6] Mining API Usage Examples from Test Code
    Zhu, Zixiao
    Zou, Yanzhen
    Xie, Bing
    Jin, Yong
    Lin, Zeqi
    Zhang, Lu
    2014 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2014, : 301 - 310
  • [7] CiD: Automating the Detection of API-Related Compatibility Issues in Android Apps
    Li, Li
    Bissyande, Tegawende F.
    Wang, Haoyu
    Klein, Jacques
    ISSTA'18: PROCEEDINGS OF THE 27TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, 2018, : 153 - 163
  • [8] API compatibility issues in Android: Causes and effectiveness of data-driven detection techniques
    Simone Scalabrino
    Gabriele Bavota
    Mario Linares-Vásquez
    Valentina Piantadosi
    Michele Lanza
    Rocco Oliveto
    Empirical Software Engineering, 2020, 25 : 5006 - 5046
  • [9] API compatibility issues in Android: Causes and effectiveness of data-driven detection techniques
    Scalabrino, Simone
    Bavota, Gabriele
    Linares-Vasquez, Mario
    Piantadosi, Valentina
    Lanza, Michele
    Oliveto, Rocco
    EMPIRICAL SOFTWARE ENGINEERING, 2020, 25 (06) : 5006 - 5046
  • [10] Using Model Checking to Generate Test Cases for Android Applications
    Rosario Espada, Ana
    del Mar Gallardo, Maria
    Salmeron, Alberto
    Merino, Pedro
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2015, (180): : 7 - 21