MULAPI: Improving API method recommendation with API usage location

Abstract During the evolution of a software system, a large number of feature requests are continuously proposed by users. To implement these feature requests, developers often utilize existing third-party libraries and make use of Application Programming Interfaces (APIs) to accelerate the feature implementation process. However, it is not always obvious which API methods are suitable and where these API methods can be used in the target program. In this paper, we propose an approach, MULAPI (Method Usage and Location for API), to recommend API methods and figure out the API usage location where these API methods would be used. MULAPI employs feature location to identify feature related files as API usage location. Further, these feature related files are taken into account to recommend API methods by exploring the source code repository and API libraries as well. We evaluate MULAPI on more than 1000 feature requests of eight Java projects (Axis/Java, CXF, Hadoop Common, Hbase, Struts2, Hadoop HDFS, Hive and Hadoop Map/Reduce), and recommend API methods from ten third-party libraries. The empirical results show that MULAPI can accurately recommend API methods and usage location, and moreover, MULAPI improves the effectiveness of API method recommendation, compared with the state-of-the-art approach.

[1]  David Lo,et al.  An effective change recommendation approach for supplementary bug fixes , 2017, Automated Software Engineering.

[2]  Wei Jiang,et al.  APISynth: a new graph-based API recommender system , 2014, ICSE Companion.

[3]  Hareton K. N. Leung,et al.  MSR4SM: Using topic models to effectively mining software repositories for software maintenance tasks , 2015, Inf. Softw. Technol..

[4]  David Lo,et al.  Cross-language bug localization , 2014, ICPC 2014.

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

[6]  G. Casella,et al.  Explaining the Gibbs Sampler , 1992 .

[7]  David Lo,et al.  WebAPIRec: Recommending Web APIs to Software Projects via Personalized Ranking , 2017, IEEE Transactions on Emerging Topics in Computational Intelligence.

[8]  Chanchal Kumar Roy,et al.  RACK: Automatic API Recommendation Using Crowdsourced Knowledge , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[9]  Siau-Cheng Khoo,et al.  A discriminative model approach for accurate duplicate bug report retrieval , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

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

[11]  David Lo,et al.  APIBot: Question answering bot for API documentation , 2017, 2017 32nd IEEE/ACM International Conference on Automated Software Engineering (ASE).

[12]  Anand Rajaraman,et al.  Mining of Massive Datasets , 2011 .

[13]  Bin Li,et al.  Using Feature-Interface Graph for Automatic Interface Recommendation: A Case Study , 2015, 2015 Third International Conference on Advanced Cloud and Big Data.

[14]  David Lo,et al.  Automated library recommendation , 2013, 2013 20th Working Conference on Reverse Engineering (WCRE).

[15]  Bin Li,et al.  Exploring topic models in software engineering data analysis: A survey , 2016, 2016 17th IEEE/ACIS International Conference on Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing (SNPD).

[16]  Martin P. Robillard,et al.  Automatic generation of suggestions for program investigation , 2005, ESEC/FSE-13.

[17]  Lars Grunske,et al.  A Critical Evaluation of Spectrum-Based Fault Localization Techniques on a Large-Scale Software System , 2017, 2017 IEEE International Conference on Software Quality, Reliability and Security (QRS).

[18]  Wenyuan Xu,et al.  REPERSP: Recommending Personalized Software Projects on GitHub , 2017, 2017 IEEE International Conference on Software Maintenance and Evolution (ICSME).

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

[20]  Ying Zou,et al.  API usage pattern recommendation for software development , 2017, J. Syst. Softw..

[21]  Bin Li,et al.  Mining Software Repositories for Automatic Interface Recommendation , 2016, Sci. Program..

[22]  David Lo,et al.  Duplicate bug report detection with a combination of information retrieval and topic modeling , 2012, 2012 Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering.

[23]  David Lo,et al.  AmaLgam+: Composing Rich Information Sources for Accurate Bug Localization , 2016, J. Softw. Evol. Process..

[24]  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).

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

[26]  Junwu Zhu,et al.  Empirical studies on the NLP techniques for source code data preprocessing , 2014, EAST 2014.

[27]  Yang Cai,et al.  Api hyperlinking via structural overlap , 2009, ESEC/SIGSOFT FSE.

[28]  Xiaobing Sun,et al.  Enhancing developer recommendation with supplementary information via mining historical commits , 2017, J. Syst. Softw..

[29]  David Lo,et al.  Detecting similar repositories on GitHub , 2017, 2017 IEEE 24th International Conference on Software Analysis, Evolution and Reengineering (SANER).

[30]  Wenyuan Xu,et al.  Personalized project recommendation on GitHub , 2017, Science China Information Sciences.

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

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

[33]  Sarfraz Khurshid,et al.  Improving bug localization using structured information retrieval , 2013, 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[34]  Bin Li,et al.  Modeling the evolution of development topics using Dynamic Topic Models , 2015, 2015 IEEE 22nd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[35]  Gabriele Bavota,et al.  How Can I Use This Method? , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[36]  Bogdan Dit,et al.  Feature location in source code: a taxonomy and survey , 2013, J. Softw. Evol. Process..

[37]  Tsunenori Mine,et al.  APIBook: an effective approach for finding APIs , 2016, Internetware.

[38]  Tao Xie,et al.  An approach to detecting duplicate bug reports using natural language and execution information , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[39]  Per Runeson,et al.  Detection of Duplicate Defect Reports Using Natural Language Processing , 2007, 29th International Conference on Software Engineering (ICSE'07).

[40]  Houari A. Sahraoui,et al.  Mining Multi-level API Usage Patterns , 2015, 2015 IEEE 22nd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[41]  Ricardo Ribeiro,et al.  Stepwise API usage assistance using n-gram language models , 2017, J. Syst. Softw..

[42]  Wenyuan Xu,et al.  Scalable Relevant Project Recommendation on GitHub , 2017, Internetware.