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 \textit{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.
Thu 19 MayDisplayed time zone: Eastern Time (US & Canada) change
10:30 - 10:45 | |||
10:30 5mTalk | Framing Program Repair as Code Completion APR Francisco Ribeiro University of Minho & HASLab, INESCTEC, Rui Abreu Faculty of Engineering, University of Porto, Portugal, João Saraiva University of Minho, Portugal | ||
10:35 10mLive Q&A | Q&A APR |