Collective Intelligence for Smarter API Recommendations in Python']Python

被引:20
作者
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 条
[21]  
Schafer M., 2013, RC25359 IBM RES
[22]  
Stylos J, 2007, PROC INT CONF SOFTW, P529