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 条
  • [21] Personalized Code Recommendation
    Tam The Nguyen
    Phong Minh Vu
    Tung Thanh Nguyen
    2019 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2019), 2019, : 313 - 317
  • [22] Demystifying code snippets in code reviews: a study of the OpenStack and Qt communities and a practitioner survey
    Zhang, Beiqi
    Fu, Liming
    Liang, Peng
    Yu, Jiaxin
    Wang, Chong
    EMPIRICAL SOFTWARE ENGINEERING, 2024, 29 (04)
  • [23] Intelligent mining vulnerabilities in python']python code snippets
    Guo, Wenbo
    Huang, Cheng
    Niu, Weina
    Fang, Yong
    JOURNAL OF INTELLIGENT & FUZZY SYSTEMS, 2021, 41 (02) : 3615 - 3628
  • [24] Fine-Grained Analysis of Similar Code Snippets
    Galasso, Jessie
    Famelis, Michalis
    Sahraoui, Houari
    REUSE AND SOFTWARE QUALITY (ICSR 2022), 2022, 13297 : 3 - 21
  • [25] On the estimation of the execution frequency of sequential program code snippets
    V. Yu. Korolev
    R. L. Smelyanskii
    T. R. Smelyanskii
    A. V. Shalimov
    Journal of Computer and Systems Sciences International, 2015, 54 : 540 - 545
  • [26] Towards Better Code Snippets: Exploring How Code Snippet Recall Differs with Programming Experience
    Ichinco, Michelle
    Kelleher, Caitlin
    2017 IEEE SYMPOSIUM ON VISUAL LANGUAGES AND HUMAN-CENTRIC COMPUTING (VL/HCC), 2017, : 37 - 41
  • [27] Towards automatically generating block comments for code snippets
    Huang, Yuan
    Huang, Shaohao
    Chen, Huanchao
    Chen, Xiangping
    Zheng, Zibin
    Luo, Xiapu
    Jia, Nan
    Hu, Xinyu
    Zhou, Xiaocong
    INFORMATION AND SOFTWARE TECHNOLOGY, 2020, 127
  • [28] SLAMPA: Recommending Code Snippets with Statistical Language Model
    Zhou, Shufan
    Zhong, Hao
    Shen, Beijun
    2018 25TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2018), 2018, : 79 - 88
  • [29] On the estimation of the execution frequency of sequential program code snippets
    Korolev, V. Yu.
    Smelyanskii, R. L.
    Smelyanskii, T. R.
    Shalimov, A. V.
    JOURNAL OF COMPUTER AND SYSTEMS SCIENCES INTERNATIONAL, 2015, 54 (04) : 540 - 545
  • [30] Precise and Scalable Querying of Syntactical Source Code Patterns Using Sample Code Snippets and a Database
    Panchenko, Oleksandr
    Karstens, Jan
    Plattner, Hasso
    Zeier, Alexander
    2011 IEEE 19TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC), 2011, : 41 - 50