An Android API Recommendation Approach Based on API Dependency Paths Learning

IF 1.5 4区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING
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,&nbsp;Jianxun Liu,&nbsp;Yi Liu,&nbsp;Yiming Yin,&nbsp;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).

基于API依赖路径学习的Android API推荐方法
软件开发在现代移动应用领域中起着至关重要的作用,通过广泛的应用体现其重要性。随着Android api的不断发展和数量的增加,开发人员需要投入大量的精力来学习如何为他们的项目使用各种合适的api。不幸的是,当前大多数推荐方法在将程序表示为源代码序列、抽象语法树或API调用路径时,通常只关注上下文关系,而忽略了API依赖关系中的有价值信息。此外,现有的序列模型(如RNN、LSTM)往往不能对高频后缀的低频API方法做出正确的预测,因为这些模型倾向于捕获最常见的API序列模式,导致这些相对低频但可能更适用的API被忽视。为了解决这个问题,我们提出了一种基于API依赖路径的Android API推荐方法DPAPIRec。该方法将程序分析与深度学习相结合,首先通过程序分析技术从大量Android app中提取API方法及其数据流和控制流依赖关系,然后获得全面的API依赖路径库。最后,采用深度学习方法对这些依赖关系进行学习和表示,以提高API推荐的准确性。此外,为了更好地提取依赖关系,我们采用了一种改进的基于注意力的LSTM模型和一种新的损失架构,通过加权混合损失增强api之间的全局依赖关系,从而增强初始节点的权重,缓解低频api带有高频后缀的问题。我们在AndroZoo数据集上的实验表明,DPAPIRec在Android API推荐任务中显著优于基线方法,在准确率和平均倒数排名(MRR)方面都有显著提高。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Concurrency and Computation-Practice & Experience
Concurrency and Computation-Practice & Experience 工程技术-计算机:理论方法
CiteScore
5.00
自引率
10.00%
发文量
664
审稿时长
9.6 months
期刊介绍: 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.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信