Jia Deng, Jianxun Liu, Yi Liu, Yiming Yin, Yong Xiao
{"title":"An Android API Recommendation Approach Based on API Dependency Paths Learning","authors":"Jia Deng, Jianxun Liu, Yi Liu, Yiming Yin, Yong Xiao","doi":"10.1002/cpe.70159","DOIUrl":null,"url":null,"abstract":"<div>\n \n <p>Software development plays a crucial role in the modern mobile application domain, reflecting its significance through widespread application. With the continuous evolution and vast number of Android APIs, developers need to invest considerable effort in learning how to use various suitable APIs for their projects. Unfortunately, most current recommendation methods, when representing programs as source code sequences, abstract syntax trees, or API call paths, often focus only on contextual relationships while ignoring valuable information in API dependency relationships. Moreover, existing sequence models (such as RNN, LSTM) often fail to make correct predictions for low-frequency API methods with high-frequency suffixes, as these models tend to capture the most common API sequence patterns, causing these relatively low-frequency but potentially more applicable APIs to be overlooked. To address this issue, we propose an API dependency path-based Android API recommendation method, DPAPIRec. This approach combines program analysis with deep learning, which first extracts API methods and their data flow and control flow dependency relationships from a large number of Android APPs through program analysis techniques and then obtains a comprehensive API dependency paths repository. Finally, a deep learning method is applied to learn and represent these dependency relationships to improve API recommendation accuracy. Furthermore, to better extract dependency relationships, we employ an improved attention-based LSTM model with a novel loss architecture, enhancing the global dependency relationships between APIs through a weighted mixed loss, thereby strengthening the weight of initial nodes and alleviating the problem of low-frequency APIs with high-frequency suffixes. Our experiments on the AndroZoo dataset demonstrate that DPAPIRec significantly outperforms baseline methods in Android API recommendation tasks, showing substantial improvements in both Accuracy and Mean Reciprocal Rank (MRR).</p>\n </div>","PeriodicalId":55214,"journal":{"name":"Concurrency and Computation-Practice & Experience","volume":"37 15-17","pages":""},"PeriodicalIF":1.5000,"publicationDate":"2025-06-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Concurrency and Computation-Practice & Experience","FirstCategoryId":"94","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1002/cpe.70159","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0
Abstract
Software development plays a crucial role in the modern mobile application domain, reflecting its significance through widespread application. With the continuous evolution and vast number of Android APIs, developers need to invest considerable effort in learning how to use various suitable APIs for their projects. Unfortunately, most current recommendation methods, when representing programs as source code sequences, abstract syntax trees, or API call paths, often focus only on contextual relationships while ignoring valuable information in API dependency relationships. Moreover, existing sequence models (such as RNN, LSTM) often fail to make correct predictions for low-frequency API methods with high-frequency suffixes, as these models tend to capture the most common API sequence patterns, causing these relatively low-frequency but potentially more applicable APIs to be overlooked. To address this issue, we propose an API dependency path-based Android API recommendation method, DPAPIRec. This approach combines program analysis with deep learning, which first extracts API methods and their data flow and control flow dependency relationships from a large number of Android APPs through program analysis techniques and then obtains a comprehensive API dependency paths repository. Finally, a deep learning method is applied to learn and represent these dependency relationships to improve API recommendation accuracy. Furthermore, to better extract dependency relationships, we employ an improved attention-based LSTM model with a novel loss architecture, enhancing the global dependency relationships between APIs through a weighted mixed loss, thereby strengthening the weight of initial nodes and alleviating the problem of low-frequency APIs with high-frequency suffixes. Our experiments on the AndroZoo dataset demonstrate that DPAPIRec significantly outperforms baseline methods in Android API recommendation tasks, showing substantial improvements in both Accuracy and Mean Reciprocal Rank (MRR).
期刊介绍:
Concurrency and Computation: Practice and Experience (CCPE) publishes high-quality, original research papers, and authoritative research review papers, in the overlapping fields of:
Parallel and distributed computing;
High-performance computing;
Computational and data science;
Artificial intelligence and machine learning;
Big data applications, algorithms, and systems;
Network science;
Ontologies and semantics;
Security and privacy;
Cloud/edge/fog computing;
Green computing; and
Quantum computing.