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 条
  • [41] A controlled experiment of different code representations for learning-based program repair
    Namavar, Marjane
    Nashid, Noor
    Mesbah, Ali
    EMPIRICAL SOFTWARE ENGINEERING, 2022, 27 (07)
  • [42] CURE: Code-Aware Neural Machine Translation for Automatic Program Repair
    Jiang, Nan
    Lutellier, Thibaud
    Tan, Lin
    2021 IEEE/ACM 43RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2021), 2021, : 1161 - 1173
  • [43] A Novel Fitness Function for Automated Program Repair Based on Source Code Checkpoints
    de Souza, Eduardo Faria
    Le Goues, Claire
    Camilo, Celso Goncalves
    GECCO'18: PROCEEDINGS OF THE 2018 GENETIC AND EVOLUTIONARY COMPUTATION CONFERENCE, 2018, : 1443 - 1450
  • [44] Intelligent Code Completion with Bayesian Networks
    Proksch, Sebastian
    Lerch, Johannes
    Mezini, Mira
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2015, 25 (01)
  • [45] Code Completion with Statistical Language Models
    Raychev, Veselin
    Vechev, Martin
    Yahav, Eran
    ACM SIGPLAN NOTICES, 2014, 49 (06) : 419 - 428
  • [46] Code Completion From Abbreviated Input
    Han, Sangmok
    Wallace, David R.
    Miller, Robert C.
    2009 IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, PROCEEDINGS, 2009, : 332 - 343
  • [47] An Empirical Study on Code Comment Completion
    Mastropaolo, Antonio
    Aghajani, Emad
    Pascarella, Luca
    Bavota, Gabriele
    2021 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME 2021), 2021, : 159 - 170
  • [48] Development of Code Completion System for Dockerfiles
    1600, Japan Society for Software Science and Technology (38):
  • [49] A Study on Repetitiveness of Code Completion Operations
    Omori, Takayuki
    Kuwabara, Hiroaki
    Maruyama, Katsuhisa
    2012 28TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE (ICSM), 2012, : 584 - 587
  • [50] Fast and Precise Statistical Code Completion
    Roos, Pascal
    2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, VOL 2, 2015, : 757 - 759