Fine-Grained Analysis of Similar Code Snippets

被引:1
|
作者
Galasso, Jessie [1 ]
Famelis, Michalis [1 ]
Sahraoui, Houari [1 ]
机构
[1] Univ Montreal, DIRO, Montreal, PQ, Canada
来源
关键词
Code recommendation; Code template; Code similarity; CLONE DETECTION;
D O I
10.1007/978-3-031-08129-3_1
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code recommendation aims to help programmers in their coding endeavors by suggesting appropriate code snippets to complete their program. Code recommendation approaches such as code search or code repair may rely on code snippets or code templates extracted from existing projects to provide these suggestions. In this context, extracting and characterizing reusable and recurring code structures beforehand is thus essential. In this paper, we characterize recurring code structures through parametrizable code templates. Code templates can outline the common structure in code snippets along with their variation points, hence providing a convenient way to define their structural similarity. Pattern Structure is a mathematical data analysis framework for organizing objects depending on their similarity: it produces a structure supporting clustering, analysis, and knowledge discovery tasks. We propose an approach leveraging this framework and similarity defined through code templates to highlight and organize groups of similar snippets. The produced structure contains all relevant code templates as well as refinement relationships between them, and can be used to support both manual and automated analysis. We present a case study where we apply this approach to analyze snippets for the task of code sophistication, which consists of identifying and suggesting missing conditional paths in programs.
引用
收藏
页码:3 / 21
页数:19
相关论文
共 50 条
  • [1] Propagating Fine-Grained Topic Labels in News Snippets
    Sarmento, Luis
    Nunes, Sergio
    Teixeira, Jorge
    Oliveira, Eugenio
    2009 IEEE/WIC/ACM INTERNATIONAL JOINT CONFERENCES ON WEB INTELLIGENCE (WI) AND INTELLIGENT AGENT TECHNOLOGIES (IAT), VOL 3, 2009, : 515 - +
  • [2] A Fine-Grained Analysis on the Inconsistent Changes in Code Clones
    Mondal, Manishankar
    Roy, Chanchal K.
    Schneider, Kevin A.
    2020 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2020), 2020, : 220 - 231
  • [3] A Fine-Grained Analysis on the Evolutionary Coupling of Cloned Code
    Mondal, Manishankar
    Roy, Chanchal K.
    Schneider, Kevin A.
    2014 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2014, : 51 - 60
  • [4] Fuzzy Fine-grained Code-history Analysis
    Servant, Francisco
    Jones, James A.
    2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2017, : 746 - 757
  • [5] A fine-grained model for code mobility
    Mascolo, C
    Picco, GP
    Roman, GC
    SOFTWARE ENGINEERING - ESEC/FSE '99, PROCEEDINGS, 1999, 1687 : 39 - 56
  • [6] Untangling Fine-Grained Code Changes
    Dias, Martin
    Bacchelli, Alberto
    Gousios, Georgios
    Cassou, Damien
    Ducasse, Stephane
    2015 22ND INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER), 2015, : 341 - 350
  • [7] Fine-Grained Code-Comment Semantic Interaction Analysis
    Geng, Mingyang
    Wang, Shangwen
    Dong, Dezun
    Gu, Shanzhi
    Peng, Fang
    Ruan, Weijian
    Liao, Xiangke
    30TH IEEE/ACM INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC 2022), 2022, : 585 - 596
  • [8] Fine-Grained Binary Code Authorship Identification
    Meng, Xiaozhu
    FSE'16: PROCEEDINGS OF THE 2016 24TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON FOUNDATIONS OF SOFTWARE ENGINEERING, 2016, : 1097 - 1099
  • [9] Practical Fine-Grained Binary Code Randomization
    Priyadarshan, Soumyakant
    Nguyen, Huan
    Sekar, R.
    36TH ANNUAL COMPUTER SECURITY APPLICATIONS CONFERENCE (ACSAC 2020), 2020, : 401 - 414
  • [10] CodeWeave: Exploring fine-grained mobility of code
    Mascolo C.
    Picco G.P.
    Roman G.-C.
    Automated Software Engineering, 2004, 11 (3) : 207 - 243