Framing Program Repair as Code Completion

Francisco Ribeiro, Rui Abreu, João Saraiva
{"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.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
框架程序修复作为代码完成
许多技术为自动程序修复的进步做出了贡献,例如:生成和验证方法,基于约束的求解器,甚至神经机器翻译。同时,人工智能允许创建支持多个下游任务的通用预训练模型。在本文中,我们描述了一种利用生成模型- CodeGPT -通过利用其代码完成功能来自动修复错误程序的技术。我们还详细说明了在有bug的行中执行代码补全的位置,以及如何规避代码生成的开放式特性,以适当地适应原始程序中的新代码。此外,我们在包含真实开源项目的ManySStuBs4J数据集上验证了我们的方法,并显示我们的工具能够修复6415个程序中的1739个——修复率为27%。修复的程序范围从单行更改到多行修改。事实上,我们的技术能够修复那些在分析之前缺少相对复杂表达式的程序。最后,我们提供了案例研究,展示了我们的技术能够处理的不同场景。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Language Models Can Prioritize Patches for Practical Program Patching Towards JavaScript program repair with Generative Pre-trained Transformer (GPT-2) Some Automatically Generated Patches are More Likely to be Correct than Others: An Analysis of Defects4J Patch Features Scaling Genetic Improvement and Automated Program Repair Revisiting Object Similarity-based Patch Ranking in Automated Program Repair: An Extensive Study
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1