基于情境感知的API个性化推荐  被引量:1

Context-aware Based API Personalized Recommendation

在线阅读下载全文

作  者:陈晨[1] 周宇[1,2] 王永超 黄志球[1,2] CHEN Chen;ZHOU Yu;WANG Yong-chao;HUANG Zhi-qiu(School of Computer Science and Engineering,Nanjing University of Aeronautics and Astronautics,Nanjing 211100,China;Key Laboratory of Safety-Critical Software,Ministry of Industry and Information Technology,Nanjing University of Aeronautics and Astronautics,Nanjing 211100,China)

机构地区:[1]南京航空航天大学计算机科学与工程学院,南京211100 [2]南京航空航天大学高安全系统的软件开发与验证技术工信部重点实验室,南京211100

出  处:《计算机科学》2021年第12期100-106,共7页Computer Science

基  金:国家重点研发计划项目(2018YFB1003900);国家自然科学基金(61972197);江苏省自然科学基金(BK20201292);江苏高校“青蓝工程”;南京航空航天大学研究生创新基地(实验室)开放基金(kfjj20191606)。

摘  要:在软件开发的过程中,开发人员在遇到编程困境时通常会检索合适的API来完成编程任务。情境信息和开发者画像在有效的API推荐中起着至关重要的作用,却在很大程度上被忽视了。因而文中提出了一种基于情境感知的API个性化推荐方法。该方法利用程序静态分析技术,对代码文件做抽象语法树解析,提取信息构建代码库,并对开发者API使用偏好建模。然后计算开发者当前查询语句与历史代码库中查询的语义相似度,检索出top-k个相似历史查询。最终利用查询语句信息、方法名信息、情境信息以及开发者API使用偏好信息对API进行重排序并推荐给开发者。通过模拟编程任务开发的不同阶段,使用MRR,MAP,Hit, NDCG评估指标来验证所提方法的有效性。实验结果表明,所提方法的API推荐效果优于基准方法,能够为开发者推荐更想要的API。In the process of software development, developers often search for appropriate APIs to complete programming tasks when encountering programming difficulties.Contextual information and developer portraits play a critical role in effective API recommendation, but they are largely overlooked.This paper proposes a novel context-aware based API personalized recommendation approach.This approach leverages program static analysis technology(abstract syntax tree) to parse the code file to extract information to construct the code base and model developer API usage preferences.Then it calculates the semantic simila-rity between the developer’s current query and the queries in the historical code base, and retrieves top-k similar historical queries.Finally, it leverages the information of query, method name, context and developer API usage preference to re-rank the candidate APIs and recommend to developers.MRR,MAP,Hit and NDCG are used to verify the effectiveness of the method in dif-ferent stages of simulation programming.The experimental results show that the proposed approach outperforms the baseline me-thod and it is more likely to recommend the APIs that developers want.

关 键 词:API推荐 程序静态分析 情境感知 开发者画像 

分 类 号:TP391[自动化与计算机技术—计算机应用技术]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象