API Code Recommendation Using Statistical Learning from Fine-grained Changes
Title | API Code Recommendation Using Statistical Learning from Fine-grained Changes |
Publication Type | Conference Paper |
Year of Publication | 2016 |
Authors | Nguyen, Anh Tuan, Hilton, Michael, Codoban, Mihai, Nguyen, Hoan Anh, Mast, Lily, Rademacher, Eli, Nguyen, Tien N., Dig, Danny |
Conference Name | Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering |
Date Published | November 2016 |
Publisher | ACM |
Conference Location | New York, NY, USA |
ISBN Number | 978-1-4503-4218-6 |
Keywords | API, API Recommendation, APIs, applications programming interfaces, compositionality, Fine-grained Code Changes, pubcrawl, Resiliency, Statistical Learning |
Abstract | 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. |
URL | https://dl.acm.org/doi/10.1145/2950290.2950333 |
DOI | 10.1145/2950290.2950333 |
Citation Key | nguyen_api_2016 |