Framing Program Repair as Code Completion

被引:3
|
作者
Ribeiro, Francisco [1 ]
Abreu, Rui [2 ,3 ]
Saraiva, Joao [1 ]
机构
[1] Univ Minho, HASLab INESC TEC, Braga, Portugal
[2] Univ Porto, INESC ID, Porto, Portugal
[3] Univ Porto, FEUP, Porto, Portugal
基金
美国安德鲁·梅隆基金会;
关键词
program repair; code generation; code completion;
D O I
10.1145/3524459.3527347
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Many techniques have contributed to the advancement of automated program repair, such as: generate and validate approaches, constraint-based solvers and even neural machine translation. Simultaneously, artificial intelligence has allowed the creation of general-purpose pre-trained models that support several downstream tasks. In this paper, we describe a technique that takes advantage of a generative model - CodeGPT - to automatically repair buggy programs by making use of its code completion capabilities. We also elaborate on where to perform code completion in a buggy line and how we circumvent the open-ended nature of code generation to appropriately fit the new code in the original program. Furthermore, we validate our approach on the ManySStuBs4j dataset containing real-world open-source projects and show that our tool is able to fix 1739 programs out of 6415 - a 27% repair rate. The repaired programs range from single-line changes to multiple line modifications. In fact, our technique is able to fix programs which were missing relatively complex expressions prior to being analyzed. In the end, we present case studies that showcase different scenarios our technique was able to handle.
引用
收藏
页码:38 / 45
页数:8
相关论文
共 50 条
  • [31] Cyanide code nears completion
    不详
    E&MJ-ENGINEERING AND MINING JOURNAL, 2002, 203 (04): : 11 - 12
  • [32] Copiloting the Copilots: Fusing Large Language Models with Completion Engines for Automated Program Repair
    Wei, Yuxiang
    Xia, Chunqiu Steven
    Zhang, Lingming
    PROCEEDINGS OF THE 31ST ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2023, 2023, : 172 - 184
  • [33] Don't Complete It! Preventing Unhelpful Code Completion for Productive and Sustainable Neural Code Completion Systems
    Sun, Zhensu
    Du, Xiaoning
    Song, Fu
    Wang, Shangwen
    Ni, Mingze
    Li, Li
    2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS, ICSE-COMPANION, 2023, : 324 - 325
  • [34] Don't Complete It! Preventing Unhelpful Code Completion for Productive and Sustainable Neural Code Completion Systems
    Sun, Zhensu
    Du, Xiaoning
    Song, Fu
    Wang, Shangwen
    Ni, Mingze
    Li, Li
    Lo, David
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2025, 34 (01)
  • [35] Review4Repair: Code review aided automatic program repairing
    Huq, Faria
    Hasan, Masum
    Haque, Md Mahim Anjum
    Mahbub, Sazan
    Iqbal, Anindya
    Ahmed, Toufique
    INFORMATION AND SOFTWARE TECHNOLOGY, 2022, 143
  • [36] Evaluating Representation Learning of Code Changes for Predicting Patch Correctness in Program Repair
    Tian, Haoye
    Liu, Kui
    Kabore, Abdoul Kader
    Koyuncu, Anil
    Li, Li
    Klein, Jacques
    Bissyande, Tegawende F.
    2020 35TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2020), 2020, : 981 - 992
  • [37] Systematic Analysis of Defect-Specific Code Abstraction for Neural Program Repair
    Kim, Kicheol
    Kim, Misoo
    Lee, Eunseok
    2022 29TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE, APSEC, 2022, : 81 - 89
  • [38] A controlled experiment of different code representations for learning-based program repair
    Marjane Namavar
    Noor Nashid
    Ali Mesbah
    Empirical Software Engineering, 2022, 27
  • [39] TransplantFix: Graph Differencing-based Code Transplantation for Automated Program Repair
    Yang, Deheng
    Mao, Xiaoguang
    Chen, Liqian
    Xu, Xuezheng
    Lei, Yan
    Lo, David
    He, Jiayu
    PROCEEDINGS OF THE 37TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2022, 2022,
  • [40] Sorting and Transforming Program Repair Ingredients via Deep Learning Code Similarities
    White, Martin
    Tufano, Michele
    Martinez, Matias
    Monperrus, Martin
    Poshyvanyk, Denys
    2019 IEEE 26TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER), 2019, : 479 - 490