Collective Intelligence for Smarter API Recommendations in Python']Python

被引:17
作者
D'Souza, Andrea Renika [1 ]
Yang, Di [1 ]
Lopes, Cristina V. [1 ]
机构
[1] Univ Calif Irvine, Dept Informat, Irvine, CA 92697 USA
来源
2016 IEEE 16TH INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM) | 2016年
关键词
D O I
10.1109/SCAM.2016.22
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Software developers use Application Programming Interfaces (APIs) of libraries and frameworks extensively while writing programs. In this context, the recommendations provided in code completion pop-ups help developers choose the desired methods. The candidate lists recommended by these tools, however, tend to be large, ordered alphabetically and sometimes even incomplete. A fair amount of work has been done recently to improve the relevance of these code completion results, especially for statically typed languages like Java. However, these proposed techniques rely on the static type of the object and are therefore inapplicable for a dynamically typed language like Python. In this paper, we present PyReco, an intelligent code completion system for Python which uses the mined API usages from open source repositories to order the results based on relevance rather than the conventional alphabetic order. To recommend suggestions that are relevant for a working context, a nearest neighbor classifier is used to identify the best matching usage among all the extracted usage patterns. To evaluate the effectiveness of our system, the code completion queries are automatically extracted from projects and tested quantitatively using a ten-fold cross validation technique. The evaluation shows that our approach outperforms the alphabetically ordered API recommendation systems in recommending APIs for standard, as well as, third-party libraries.
引用
收藏
页码:51 / 60
页数:10
相关论文
共 22 条
[1]  
[Anonymous], 2015, THESIS
[2]  
[Anonymous], 2009, ENCY DATABASE SYSTEM, DOI DOI 10.1007/978-0-387-39940-9_488
[3]   CSCC: Simple, Efficient, Context Sensitive Code Completion [J].
Asaduzzaman, Muhammad ;
Roy, Chanchal K. ;
Schneider, Kevin A. ;
Hou, Daqing .
2014 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2014, :71-80
[4]  
Bruch M., 2008, P 2008 INT WORKSHOP, P16, DOI DOI 10.1145/1454247.1454254
[5]   Learning from Examples to Improve Code Completion Systems [J].
Bruch, Marcel ;
Monperrus, Martin ;
Mezini, Mira .
7TH JOINT MEETING OF THE EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND THE ACM SIGSOFT SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, 2009, :213-222
[6]  
Bruch Marcel., 2006, P 4 OOPSLA WORKSHOP, P55, DOI [10.1145/1188835.1188847, DOI 10.1145/1188835.1188847]
[7]   CACHECA: A Cache Language Model Based Code Suggestion Tool [J].
Franks, Christine ;
Tu, Zhaopeng ;
Devanbu, Premkumar ;
Hellendoorn, Vincent .
2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, VOL 2, 2015, :705-708
[8]  
Heinemann L., 2011, Proceedings of the 3rd International Workshop on Search-Driven Development: Users, Infrastructure, Tools, and Evaluation, P1
[9]  
Hou Daqing, 2010, 2 INT WORKSH REC SYS, P26
[10]  
Krause E.F., 2012, Taxicab geometry: An adventure in non-Euclidean geometry