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 条
  • [41] CodeCatch: Extracting Source Code Snippets from Online Sources
    Diamantopoulos, Themistoklis
    Karagiannopoulos, Georgios
    Symeonidis, Andreas L.
    2018 IEEE/ACM 6TH INTERNATIONAL WORKSHOP ON REALIZING ARTIFICIAL INTELLIGENCE SYNERGIES IN SOFTWARE ENGINEERING (RAISE), 2018, : 21 - 27
  • [42] APIzation: Generating Reusable APIs from StackOverflow Code Snippets
    Terragni, Valerio
    Salza, Pasquale
    2021 36TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING ASE 2021, 2021, : 542 - 554
  • [43] Leveraging Code-Test Co-evolution Patterns for Automated Test Case Recommendation
    Shimmi, Samiha
    Rahimi, Mona
    3RD ACM/IEEE INTERNATIONAL CONFERENCE ON AUTOMATION OF SOFTWARE TEST (AST 2022), 2022, : 65 - 76
  • [44] Ontology-based code snippets management in a cloud environment
    Shi, Jianjun
    Ji, Weixing
    Gao, Zhiwei
    Gao, Yujin
    Wang, Yizhuo
    Liao, Xinyi
    Shi, Feng
    JOURNAL OF AMBIENT INTELLIGENCE AND HUMANIZED COMPUTING, 2019, 10 (08) : 2971 - 2985
  • [45] Ontology-based code snippets management in a cloud environment
    Jianjun Shi
    Weixing Ji
    Zhiwei Gao
    Yujin Gao
    Yizhuo Wang
    Xinyi Liao
    Feng Shi
    Journal of Ambient Intelligence and Humanized Computing, 2019, 10 : 2971 - 2985
  • [46] Usage and attribution of Stack Overflow code snippets in GitHub projects
    Baltes, Sebastian
    Diehl, Stephan
    EMPIRICAL SOFTWARE ENGINEERING, 2019, 24 (03) : 1259 - 1295
  • [47] Identifying versions of libraries used in stack overflow code snippets
    Zerouali, Ahmed
    Velazquez-Rodriguez, Camilo
    De Roover, Coen
    Proceedings - 2021 IEEE/ACM 18th International Conference on Mining Software Repositories, MSR 2021, 2021, : 341 - 345
  • [48] Relevance Transformer: Generating Concise Code Snippets with Relevance Feedback
    Gemmell, Carlos
    Rossetto, Federico
    Dalton, Jeffrey
    PROCEEDINGS OF THE 43RD INTERNATIONAL ACM SIGIR CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION RETRIEVAL (SIGIR '20), 2020, : 2005 - 2008
  • [49] Attribution Required: Stack Overflow Code Snippets in GitHub Projects
    Baltes, Sebastian
    Kiefer, Richard
    Diehl, Stephan
    PROCEEDINGS OF THE 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C 2017), 2017, : 161 - 163
  • [50] What Information about Code Snippets Is Available in Different Software-Related Documents? An Exploratory Study
    Chatterjee, Preetha
    Nishi, Manziba Akanda
    Damevski, Kostadin
    Augustine, Vinay
    Pollock, Lori
    Kraft, Nicholas A.
    2017 IEEE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), 2017, : 382 - 386