Application Programming Interface (API) incompatibility is a long-standing issue in Android application development. The rapid evolution of Android APIs results in a significant number of API additions, removals, and changes between adjacent versions. Unfortunately, this high frequency of alterations may lead to compatibility issues, often without adequate notification to developers regarding these changes. Although researchers have proposed some work on detecting compatibility issues caused by changes in API signatures, they often overlook compatibility issues stemming from sophisticated semantic changes. In response to this challenge, we conducted a large-scale discovery of incompatible APIs in the Android Open Source Project (AOSP) by leveraging static analysis and pre-trained Large Language Models (LLMs) across adjacent versions. We systematically formulate the problem and propose a unified framework to detect incompatible APIs, especially for semantic changes. It's worth highlighting that our approach achieves a 0.83 F1-score in identifying semantically incompatible APIs in the Android framework. Ultimately, our approach detects 5,481 incompatible APIs spanning from version 4 to version 33. We further demonstrate its effectiveness in supplementing the state-of-the-art methods in detecting a broader spectrum of compatibility issues (+92.3%) that have been previously overlooked.
翻译:应用程序编程接口(API)不兼容是Android应用开发中长期存在的问题。Android API的快速演进导致相邻版本之间存在大量API的添加、移除和变更。遗憾的是,这种高频变更可能导致兼容性问题,且开发者往往未能获得关于这些变更的充分通知。尽管已有研究者提出检测API签名变更引发兼容性问题的相关工作,但通常忽略了由复杂语义变化导致的兼容性问题。为应对这一挑战,我们通过静态分析与预训练大语言模型(LLMs)相结合的方法,在Android开源项目(AOSP)的相邻版本间开展了大规模不兼容API发现研究。我们系统化地阐述了该问题,并提出一个统一框架以检测不兼容API,尤其针对语义变更。值得强调的是,我们的方法在识别Android框架中语义不兼容API方面取得了0.83的F1分数。最终,我们的方法检测到从版本4至版本33共5,481个不兼容API。我们进一步证明该方法能有效补充现有最先进方法,检测出更广泛谱系的兼容性问题(+92.3%),这些问题以往常被忽视。