Effective API Recommendation without Historical Software Repositories

It is time-consuming and labor-intensive to learn and locate the correct API for programming tasks. Thus, it is beneficial to perform API recommendation automatically. The graph-based statistical model has been shown to recommend top-10 API candidates effectively. It falls short, however, in accurately recommending an actual top-1 API. To address this weakness, we propose RecRank, an approach and tool that applies a novel ranking-based discriminative approach leveraging API usage path features to improve top-1 API recommendation. Empirical evaluation on a large corpus of (1385+8) open source projects shows that RecRank significantly improves top-1 API recommendation accuracy and mean reciprocal rank when compared to state-of-the-art API recommendation approaches.

[1]  Rosco Hill,et al.  Automatic method completion , 2004, Proceedings. 19th International Conference on Automated Software Engineering, 2004..

[2]  Romain Robbes,et al.  How Program History Can Improve Code Completion , 2008, 2008 23rd IEEE/ACM International Conference on Automated Software Engineering.

[3]  Chanchal Kumar Roy,et al.  Exploring API method parameter recommendations , 2015, 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[4]  Hong Cheng,et al.  Searching connected API subgraph via text phrases , 2012, SIGSOFT FSE.

[5]  Premkumar T. Devanbu,et al.  Recommending random walks , 2007, ESEC-FSE '07.

[6]  Chanchal Kumar Roy,et al.  A Simple, Efficient, Context‐sensitive Approach for Code Completion , 2016, J. Softw. Evol. Process..

[7]  Dongmei Zhang,et al.  CodeHow: Effective Code Search Based on API Understanding and Extended Boolean Model (E) , 2015, 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[8]  Martin White,et al.  Toward Deep Learning Software Repositories , 2015, 2015 IEEE/ACM 12th Working Conference on Mining Software Repositories.

[9]  Yi Zhang,et al.  Automatic parameter recommendation for practical API usage , 2012, 2012 34th International Conference on Software Engineering (ICSE).

[10]  Charles A. Sutton,et al.  Learning natural coding conventions , 2014, SIGSOFT FSE.

[11]  David Lo,et al.  Automatic recommendation of API methods from feature requests , 2013, 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[12]  Andrew D. Gordon,et al.  Bimodal Modelling of Source Code and Natural Language , 2015, ICML.

[13]  Steven P. Reiss,et al.  Semantics-based code search , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[14]  N. Cliff Dominance statistics: Ordinal analyses to answer ordinal questions. , 1993 .

[15]  Collin McMillan,et al.  ExPort: Detecting and visualizing API usages in large source code repositories , 2013, 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[16]  Tao Wang,et al.  Convolutional Neural Networks over Tree Structures for Programming Language Processing , 2014, AAAI.

[17]  Charles A. Sutton,et al.  Parameter-Free Probabilistic API Mining at GitHub Scale , 2015, ArXiv.

[18]  Xiaodong Gu,et al.  Deep API learning , 2016, SIGSOFT FSE.

[19]  J. H. FREMLIN,et al.  “Significant” and “Highly Significant” , 1966, Nature.

[20]  Eran Yahav,et al.  Code completion with statistical language models , 2014, PLDI.

[21]  Collin McMillan,et al.  Recommending source code examples via API call usages and documentation , 2010, RSSE '10.

[22]  Thomas D. LaToza,et al.  Active code completion , 2011, 2012 34th International Conference on Software Engineering (ICSE).

[23]  Kai Chen,et al.  Mining succinct and high-coverage API usage patterns from source code , 2013, 2013 10th Working Conference on Mining Software Repositories (MSR).

[24]  Collin McMillan,et al.  Portfolio: finding relevant functions and their usage , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[25]  Jian Pei,et al.  MAPO: mining API usages from open source repositories , 2006, MSR '06.

[26]  Daqing Hou,et al.  An evaluation of the strategies of sorting, filtering, and grouping API methods for Code Completion , 2011, 2011 27th IEEE International Conference on Software Maintenance (ICSM).

[27]  Bin Li,et al.  MULAPI: Improving API method recommendation with API usage location , 2018, J. Syst. Softw..

[28]  Mira Mezini,et al.  Learning from examples to improve code completion systems , 2009, ESEC/SIGSOFT FSE.

[29]  Ellen M. Voorhees,et al.  The TREC-8 Question Answering Track Report , 1999, TREC.

[30]  Kathryn T. Stolee,et al.  Toward semantic search via SMT solver , 2012, SIGSOFT FSE.

[31]  Thorsten Joachims,et al.  Training linear SVMs in linear time , 2006, KDD '06.

[32]  Trong Duc Nguyen,et al.  Exploring API Embedding for API Usages and Applications , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[33]  Danny Dig,et al.  API code recommendation using statistical learning from fine-grained changes , 2016, SIGSOFT FSE.

[34]  Daniel Tarlow,et al.  Structured Generative Models of Natural Source Code , 2014, ICML.

[35]  Martin P. Robillard,et al.  Using Structure-Based Recommendations to Facilitate Discoverability in APIs , 2011, ECOOP.

[36]  Charles A. Sutton,et al.  Parameter-free probabilistic API mining across GitHub , 2015, SIGSOFT FSE.

[37]  R. Holmes,et al.  Using structural context to recommend source code examples , 2005, Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005..

[38]  Anh Tuan Nguyen,et al.  Graph-Based Statistical Language Model for Code , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[39]  Chih-Jen Lin,et al.  LIBLINEAR: A Library for Large Linear Classification , 2008, J. Mach. Learn. Res..