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 条
  • [21] Research and Progress on Learning-Based Source Code Vulnerability Detection
    Su X.-H.
    Zheng W.-N.
    Jiang Y.
    Wei H.-W.
    Wan J.-Y.
    Wei Z.-Y.
    Jisuanji Xuebao/Chinese Journal of Computers, 2024, 47 (02): : 337 - 374
  • [22] A Review of Deep Learning-Based Binary Code Similarity Analysis
    Du, Jiang
    Wei, Qiang
    Wang, Yisen
    Sun, Xiangjie
    ELECTRONICS, 2023, 12 (22)
  • [23] A Survey on Deep Learning-Based Source Code Defect Analysis
    Guan, Zhibin
    Wang, Xiaomeng
    Xin, Wei
    Wang, Jiajie
    Zhang, Li
    2020 5TH INTERNATIONAL CONFERENCE ON COMPUTER AND COMMUNICATION SYSTEMS (ICCCS 2020), 2020, : 167 - 171
  • [24] Deep Learning-Based Code Refactoring: A Review of Current Knowledge
    Naik, Purnima
    Nelaballi, Salomi
    Pusuluri, Venkata Sai
    Kim, Dae-Kyoo
    SSRN, 2022,
  • [25] QRnet: fast learning-based QR code image embedding
    Karelia Pena-Pena
    Daniel L. Lau
    Andrew J. Arce
    Gonzalo R. Arce
    Multimedia Tools and Applications, 2022, 81 : 10653 - 10672
  • [26] Machine Learning-Based Methods for Code Smell Detection: A Survey
    Yadav, Pravin Singh
    Rao, Rajwant Singh
    Mishra, Alok
    Gupta, Manjari
    APPLIED SCIENCES-BASEL, 2024, 14 (14):
  • [27] Code Smell Detection: Towards a Machine Learning-based Approach
    Fontana, Francesca Arcelli
    Zanoni, Marco
    Marino, Alessandro
    Mantyla, Mika V.
    2013 29TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), 2013, : 396 - 399
  • [28] Fairness Analysis of Machine Learning-Based Code Reviewer Recommendation
    Mohajer, Mohammad Mahdi
    Belle, Alvine Boaye
    Harzevili, Nima Shiri
    Wang, Junjie
    Hemmati, Hadi
    Wang, Song
    Jiang, Zhen Ming
    ADVANCES IN BIAS AND FAIRNESS IN INFORMATION RETRIEVAL, BIAS 2024, 2025, 2227 : 46 - 63
  • [29] Deep Learning-Based Code Refactoring: A Review of Current Knowledge
    Naik, Purnima
    Nelaballi, Salomi
    Pusuluri, Venkata Sai
    Kim, Dae-Kyoo
    JOURNAL OF COMPUTER INFORMATION SYSTEMS, 2024, 64 (02) : 314 - 328
  • [30] A parallel deep learning-based code clone detection model
    Zhang, Xiangping
    Liu, Jianxun
    Shi, Min
    JOURNAL OF PARALLEL AND DISTRIBUTED COMPUTING, 2023, 181