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 条
  • [11] Slicing Fine-Grained Code Change History
    Maruyama, Katsuhisa
    Omori, Takayuki
    Hayashi, Shinpei
    IEICE TRANSACTIONS ON INFORMATION AND SYSTEMS, 2016, E99D (03): : 671 - 687
  • [12] Visualization of Fine-Grained Code Change History
    Yoon, YoungSeok
    Myers, Brad A.
    Koo, Sebon
    2013 IEEE SYMPOSIUM ON VISUAL LANGUAGES AND HUMAN-CENTRIC COMPUTING (VL/HCC 2013), 2013, : 119 - 126
  • [13] Fine-grained Code Changes Tracking Approach for Code Review
    Wang M.
    Pan X.-L.
    Zou Y.-Z.
    Xie B.
    Ruan Jian Xue Bao/Journal of Software, 2023, 34 (10): : 4705 - 4723
  • [14] Fine-Grained Crowdsourcing for Fine-Grained Recognition
    Jia Deng
    Krause, Jonathan
    Li Fei-Fei
    2013 IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR), 2013, : 580 - 587
  • [15] Fine-Grained Obfuscation Scheme Recognition on Binary Code
    Tian, Zhenzhou
    Mao, Hengchao
    Huang, Yaqian
    Tian, Jie
    Li, Jinrui
    DIGITAL FORENSICS AND CYBER CRIME, ICDF2C 2021, 2022, 441 : 215 - 228
  • [16] SPDebugger: A Fine-Grained Deterministic Debugger for Concurrency Code
    Lin, Ziyi
    Zhou, Yilei
    Zhong, Hao
    Chen, Yuting
    Yu, Haibo
    Zhao, Jianjun
    IEICE TRANSACTIONS ON INFORMATION AND SYSTEMS, 2017, E100D (03): : 473 - 482
  • [17] Fine-grained interlaced code loading for mobile systems
    Stoops, L
    Mens, T
    D'Hondt, T
    MOBILE AGENTS, PROCEEDINGS, 2002, 2535 : 78 - 92
  • [18] Mining Fine-Grained Code Change Patterns Using Multiple Feature Analysis
    Liu, Di
    Feng, Yang
    INTERNATIONAL JOURNAL OF SOFTWARE ENGINEERING AND KNOWLEDGE ENGINEERING, 2025, 35 (01) : 111 - 138
  • [19] Are These Birds Similar: Learning Branched Networks for Fine-grained Representations
    Nawaz, Shah
    Calefati, Alessandro
    Caraffini, Moreno
    Landro, Nicola
    Gallo, Ignazio
    2019 INTERNATIONAL CONFERENCE ON IMAGE AND VISION COMPUTING NEW ZEALAND (IVCNZ), 2019,
  • [20] Fine-Grained Analysis of Financial Tweets
    Chen, Chung-Chi
    Huang, Hen-Hsen
    Chen, Hsin-Hsi
    COMPANION PROCEEDINGS OF THE WORLD WIDE WEB CONFERENCE 2018 (WWW 2018), 2018, : 1943 - 1949