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 条
  • [1] Improving code completion with program history
    Romain Robbes
    Michele Lanza
    Automated Software Engineering, 2010, 17 : 181 - 212
  • [2] Improving code completion with program history
    Robbes, Romain
    Lanza, Michele
    AUTOMATED SOFTWARE ENGINEERING, 2010, 17 (02) : 181 - 212
  • [3] Visualizing Code Genealogy - How Code is Evolutionarily Fixed in Program Repair?
    Tomida, Yuya
    Higo, Yoshiki
    Matsumoto, Shinsuke
    Kusumoto, Shinji
    2019 SEVENTH IEEE WORKING CONFERENCE ON SOFTWARE VISUALIZATION (VISSOFT), 2019, : 23 - 27
  • [4] A Neural Network Based Intelligent Support Model for Program Code Completion
    Rahman, Md Mostafizer
    Watanobe, Yutaka
    Nakamura, Keita
    SCIENTIFIC PROGRAMMING, 2020, 2020
  • [5] Combining Program Analysis and Statistical Language Model for Code Statement Completion
    Nguyen, Son
    Nguyen, Tien N.
    Li, Yi
    Wang, Shaohua
    34TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2019), 2019, : 722 - 733
  • [6] Impact of Code Language Models on Automated Program Repair
    Jiang, Nan
    Liu, Kevin
    Lutellier, Thibaud
    Tan, Lin
    2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 1430 - 1442
  • [7] Better Code Search and Reuse for Better Program Repair
    Xin, Qi
    Reiss, Steven
    2019 IEEE/ACM 6TH INTERNATIONAL WORKSHOP ON GENETIC IMPROVEMENT (GI@ICSE 2019), 2019, : 10 - 17
  • [8] Embedding Context as Code Dependencies for Neural Program Repair
    Nashid, Noor
    Sintaha, Mifta
    Mesbah, Ali
    2023 IEEE CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION, ICST, 2023, : 95 - 106
  • [9] DynaMoth: Dynamic Code Synthesis for Automatic Program Repair
    Durieux, Thomas
    Monperrus, Martin
    2016 IEEE/ACM 11TH INTERNATIONAL WORKSHOP IN AUTOMATION OF SOFTWARE TEST (AST), 2016, : 85 - 91
  • [10] Automated Large Program Repair based on Big Code
    Hoang Van Thuy
    Phan Viet Anh
    Nguyen Xuan Hoai
    PROCEEDINGS OF THE NINTH INTERNATIONAL SYMPOSIUM ON INFORMATION AND COMMUNICATION TECHNOLOGY (SOICT 2018), 2018, : 375 - 381