A controlled experiment of different code representations for learning-based program repair

被引:8
|
作者
Namavar, Marjane [1 ]
Nashid, Noor [1 ]
Mesbah, Ali [1 ]
机构
[1] Univ British Columbia, Vancouver, BC, Canada
关键词
Program repair; Deep learning; Code representation; Controlled experiment; TOOL;
D O I
10.1007/s10664-022-10223-5
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Training a deep learning model on source code has gained significant traction recently. Since such models reason about vectors of numbers, source code needs to be converted to a code representation before vectorization. Numerous approaches have been proposed to represent source code, from sequences of tokens to abstract syntax trees. However, there is no systematic study to understand the effect of code representation on learning performance. Through a controlled experiment, we examine the impact of various code representations on model accuracy and usefulness in deep learning-based program repair. We train 21 different generative models that suggest fixes for name-based bugs, including 14 different homogeneous code representations, four mixed representations for the buggy and fixed code, and three different embeddings. We assess if fix suggestions produced by the model in various code representations are automatically patchable, meaning they can be transformed to a valid code that is ready to be applied to the buggy code to fix it. We also conduct a developer study to qualitatively evaluate the usefulness of inferred fixes in different code representations. Our results highlight the importance of code representation and its impact on learning and usefulness. Our findings indicate that (1) while code abstractions help the learning process, they can adversely impact the usefulness of inferred fixes from a developer's point of view; this emphasizes the need to look at the patches generated from the practitioner's perspective, which is often neglected in the literature, (2) mixed representations can outperform homogeneous code representations, (3) bug type can affect the effectiveness of different code representations; although current techniques use a single code representation for all bug types, there is no single best code representation applicable to all bug types.
引用
收藏
页数:39
相关论文
共 50 条
  • [41] Identifying Incorrect Patches in Program Repair Based on Meaning of Source Code
    Quang-Ngoc Phung
    Kim, Misoo
    Lee, Eunseok
    IEEE ACCESS, 2022, 10 : 12012 - 12030
  • [42] DLFix: Context-based Code Transformation Automated Program Repair
    Li, Yi
    Wang, Shaohua
    Nguyen, Tien N.
    2020 ACM/IEEE 42ND INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2020), 2020, : 602 - 614
  • [43] DLBT: Deep Learning-Based Transformer to Generate Pseudo-Code from Source Code
    Gad, Walaa
    Alokla, Anas
    Nazih, Waleed
    Aref, Mustafa
    Salem, Abdel-badeeh
    CMC-COMPUTERS MATERIALS & CONTINUA, 2022, 70 (02): : 3117 - 3132
  • [44] On the Role of Data Balancing for Machine Learning-Based Code Smell Detection
    Pecorelli, Fabiano
    Di Nucci, Dario
    De Roover, Coen
    De Lucia, Andrea
    PROCEEDINGS OF THE 3RD ACM SIGSOFT INTERNATIONAL WORKSHOP ON MACHINE LEARNING TECHNIQUES FOR SOFTWARE QUALITY EVALUATION (MALTESQUE '19), 2019, : 19 - 24
  • [45] On Representation Learning-based Methods for Effective, Efficient, and Scalable Code Retrieval
    Franca, Celso
    Lima, Rennan C.
    Andrade, Claudio
    Cunha, Washington
    Melo, Pedro O. S. Vaz de
    Ribeiro-Neto, Berthier
    Rocha, Leonardo
    Santos, Rodrygo L. T.
    Pagano, Adriana Silvina
    Goncalves, Marcos Andre
    NEUROCOMPUTING, 2024, 600
  • [46] Effective Hard Negative Mining for Contrastive Learning-Based Code Search
    Fan, Ye
    Li, Chuanyi
    Ge, Jidong
    Huang, Liguo
    Luo, Bin
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2025, 34 (03)
  • [47] Rank Learning-Based Code Readability Assessment with Siamese Neural Networks
    Mi, Qing
    PROCEEDINGS OF THE 37TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2022, 2022,
  • [48] Registries in Machine Learning-Based Drug Discovery: A Shortcut to Code Reuse
    Hartog, Peter B. R.
    Svensson, Emma
    Mervin, Lewis
    Genheden, Samuel
    Engkvist, Ola
    Tetko, Igor V.
    AI IN DRUG DISCOVERY, AIDD 2024, 2025, 14894 : 98 - 115
  • [49] Deep Learning-Based Code Auto-Completion for Distributed Applications
    Alizadehsani, Zakieh
    Pinto-Santos, Francisco
    Alonso-Moro, David
    Berrocal Macias, David
    Gonzalez-Briones, Alfonso
    19TH INTERNATIONAL SYMPOSIUM ON DISTRIBUTED COMPUTING AND ARTIFICIAL INTELLIGENCE, 2023, 583 : 131 - 143
  • [50] Machine Learning-Based Security Pattern Recognition Techniques for Code Developers
    Zaharia, Sergiu
    Rebedea, Traian
    Trausan-Matu, Stefan
    APPLIED SCIENCES-BASEL, 2022, 12 (23):