API code recommendation using statistical learning from fine-grained changes

API code recommendation using statistical learning from fine-grained changes
复制标题

DOI:
10.1145/2950290.2950333
复制
发表时间:
2016-11
期刊:
Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering
影响因子:
--
通讯作者:
A. Nguyen;Michael C Hilton;Mihai Codoban;H. Nguyen;L. Mast;E. Rademacher;T. Nguyen;Danny Dig
A. Nguyen;Michael C Hilton;Mihai Codoban;H. Nguyen;L. Mast;E. Rademacher;T. Nguyen;Danny Dig
中科院分区:
其他
文献类型:
--
作者:
A. Nguyen;Michael C Hilton;Mihai Codoban;H. Nguyen;L. Mast;E. Rademacher;T. Nguyen;Danny Dig

文献摘要

被引文献

相似文献

学习和记住如何使用API​​是困难的。虽然代码完成工具可以推荐API方法,但浏览一长串API方法名称及其文档很乏味。此外,用户很容易被过多的信息淹没。我们提出了一种新型的API建议方法,该方法介绍了重复代码更改的预测能力,以为开发人员提供相关的API建议。我们的方法和工具APIREC基于从细粒度代码更改以及进行这些更改的情况下的统计学习。我们的经验评估表明,APIREC正确建议在第一个位置59%的API呼叫,并建议在77%的时间内在前五个职位中进行正确的API呼叫。对于TOP-1的准确性,这是对最先进的方法的显着改善,对于TOP-5的准确性,这是10-30%。我们的结果表明,即使使用50个公开项目的一次性培训数据集,APIREC的表现也很好。
Learning and remembering how to use APIs is difficult. While code-completion tools can recommend API methods, browsing a long list of API method names and their documentation is tedious. Moreover, users can easily be overwhelmed with too much information. We present a novel API recommendation approach that taps into the predictive power of repetitive code changes to provide relevant API recommendations for developers. Our approach and tool, APIREC, is based on statistical learning from fine-grained code changes and from the context in which those changes were made. Our empirical evaluation shows that APIREC correctly recommends an API call in the first position 59% of the time, and it recommends the correct API call in the top five positions 77% of the time. This is a significant improvement over the state-of-the-art approaches by 30-160% for top-1 accuracy, and 10-30% for top-5 accuracy, respectively. Our result shows that APIREC performs well even with a one-time, minimal training dataset of 50 publicly available projects.