SENSORY: Leveraging Code Statement Sequence Information for Code Snippets Recommendation

被引:16
作者
Ai, Lei [1 ]
Huang, Zhiqiu [1 ]
Li, Weiwei [2 ]
Zhou, Yu [1 ]
Yu, Yaoshen [1 ]
机构
[1] Nanjing Univ Aeronaut & Astronaut, Coll Comp Sci & Technol, Nanjing, Peoples R China
[2] Nanjing Univ Aeronaut & Astronaut, Coll Astronaut, Nanjing, Peoples R China
来源
2019 IEEE 43RD ANNUAL COMPUTER SOFTWARE AND APPLICATIONS CONFERENCE (COMPSAC), VOL 1 | 2019年
基金
国家重点研发计划; 中国博士后科学基金;
关键词
code snippets recommendation; code statement sequence; structure information; programming context;
D O I
10.1109/COMPSAC.2019.00014
中图分类号
TP39 [计算机的应用];
学科分类号
081203 ; 0835 ;
摘要
Software developers often have to implement unfamiliar programming tasks. When faced with these problems, developers often search online for code snippets as references to learn how to solve the unfamiliar tasks. In recent years, some researchers propose several approaches to use programming context to recommend code snippets. Most of these approaches use information retrieval based techniques and treat code snippets as a set of tokens. However, in code, the smallest meaningful unit is code statement, in general, the line of code. Since these studies did not consider this issue, there is still room for improvement in the code snippets recommendation. In this paper, we propose a code Statement sEquence iNformation baSed cOde snippets Recommendation sYstem (SENSORY). Different from existing token based approaches, SENSORY performs code snippets recommendation at code statement granularity. It uses the Burrows Wheeler Transform algorithm to search relevant code snippets, and uses the structure information to re-rank the results. To evaluate the effectiveness of our proposed method, we construct a code database with 1000000 real world code snippets which contain more than 15000000 lines of code. The experimental results show that SENSORY outperforms the two strong baseline work in terms of precision and NDCG.
引用
收藏
页码:27 / 36
页数:10
相关论文
共 29 条
[1]  
[Anonymous], P 3 INT WORKSH SEARC
[2]  
[Anonymous], 2005, Proc. 10th Eur. Softw. Eng. Conf. held jointly with 13th ACM SIGSOFT Int. Symp. Found. Softw. Eng
[3]  
Antunes B., 2014, CONTEXT COMPUT, P45
[4]  
Bajracharya S. K., 2012, ANAL MINING CODE SEA
[5]   Mining Search Topics from a Code Search Engine Usage Log [J].
Bajracharya, Sushil ;
Lopes, Cristina .
2009 6TH IEEE INTERNATIONAL WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES, 2009, :111-120
[6]  
Burrows M, 1994, SRC RES REPORT, V124
[7]  
Holmes R., 2005, P 27 INT C SOFTW ENG
[8]  
Huang Q., 2018, P 33 ACM IEEE INT C
[9]  
Inoue K, 2012, PROC INT CONF SOFTW, P331, DOI 10.1109/ICSE.2012.6227181
[10]   ROSF: Leveraging Information Retrieval and Supervised Learning for Recommending Code Snippets [J].
Jiang, He ;
Nie, Liming ;
Sun, Zeyi ;
Ren, Zhilei ;
Kong, Weiqiang ;
Zhang, Tao ;
Luo, Xiapu .
IEEE TRANSACTIONS ON SERVICES COMPUTING, 2019, 12 (01) :34-46