SENSORY: Leveraging Code Statement Sequence Information for Code Snippets Recommendation

被引:15
|
作者
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
基金
国家重点研发计划; 中国博士后科学基金;
关键词
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
相关论文
共 50 条
  • [1] ROSF: Leveraging Information Retrieval and Supervised Learning for Recommending Code Snippets
    Jiang, He
    Nie, Liming
    Sun, Zeyi
    Ren, Zhilei
    Kong, Weiqiang
    Zhang, Tao
    Luo, Xiapu
    IEEE TRANSACTIONS ON SERVICES COMPUTING, 2019, 12 (01) : 34 - 46
  • [2] Leveraging Code Snippets to Detect Variations in the Performance of HPC Systems
    Zhai, Jidong
    Zheng, Liyan
    Sun, Jinghan
    Zhang, Feng
    Tang, Xiongchao
    Qian, Xuehai
    He, Bingsheng
    Xue, Wei
    Chen, Wenguang
    Zheng, Weimin
    IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, 2022, 33 (12) : 3558 - 3574
  • [3] Source Code Recommendation with Sequence Learning of Code Functions
    Saito, Erika
    Takano, Kosuke
    ADVANCED INFORMATION NETWORKING AND APPLICATIONS, AINA-2022, VOL 3, 2022, 451 : 314 - 323
  • [4] CoSS: Leveraging Statement Semantics for Code Summarization
    Shi, Chaochen
    Cai, Borui
    Zhao, Yao
    Gao, Longxiang
    Sood, Keshav
    Xiang, Yong
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2023, 49 (06) : 3472 - 3486
  • [5] MACs: Mining API code snippets for code reuse
    Hsu, Sheng-Kuei
    Lin, Shi-Jen
    EXPERT SYSTEMS WITH APPLICATIONS, 2011, 38 (06) : 7291 - 7301
  • [6] Recommending Code Reviews Leveraging Code Changes with Structured Information Retrieval
    Shuvo, Ohiduzzaman
    Mahbub, Parvez
    Rahman, Mohammad Masudur
    2023 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION, ICSME, 2023, : 194 - 206
  • [7] Watch and Learn Using Code Snippets
    Mekouar, Loubna
    PROCEEDINGS OF THE 2022 IEEE GLOBAL ENGINEERING EDUCATION CONFERENCE (EDUCON 2022), 2022, : 1934 - 1937
  • [8] Toxic Code Snippets on Stack Overflow
    Ragkhitwetsagul, Chaiyong
    Krinke, Jens
    Paixao, Matheus
    Bianco, Giuseppe
    Oliveto, Rocco
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2021, 47 (03) : 560 - 581
  • [9] Tools for code snippets: A literature review
    de Moraes, Rodrigo Vieira
    REVISTA BRASILEIRA DE COMPUTACAO APLICADA, 2016, 8 (03): : 51 - 65
  • [10] Making Sense of Online Code Snippets
    Subramanian, Siddharth
    Holmes, Reid
    2013 10TH IEEE WORKING CONFERENCE ON MINING SOFTWARE REPOSITORIES (MSR), 2013, : 85 - 88