{"title":"Framing Program Repair as Code Completion","authors":"Francisco Ribeiro, Rui Abreu, João Saraiva","doi":"10.1145/3524459.3527347","DOIUrl":null,"url":null,"abstract":"Many techniques have contributed to the advancement of auto-mated program repair, such as: generate and validate approaches, constraint-based solvers and even neural machine translation. Si-multaneously, artificial intelligence has allowed the creation of general-purpose pre-trained models that support several down-stream 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 capa-bilities. 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 pro-gram. 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.","PeriodicalId":131481,"journal":{"name":"2022 IEEE/ACM International Workshop on Automated Program Repair (APR)","volume":"54 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2022 IEEE/ACM International Workshop on Automated Program Repair (APR)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3524459.3527347","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3
Abstract
Many techniques have contributed to the advancement of auto-mated program repair, such as: generate and validate approaches, constraint-based solvers and even neural machine translation. Si-multaneously, artificial intelligence has allowed the creation of general-purpose pre-trained models that support several down-stream 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 capa-bilities. 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 pro-gram. 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.