arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.08157cs.SE
收藏

MCRepair:通过带缺陷块的补丁优化实现多块程序修复

MCRepair: Multi-Chunk Program Repair via Patch Optimization with Buggy Block

Jisung Kim, Byeongjung Lee

AI总结:

针对多块程序修复中依赖关系处理难、补丁空间大、候选补丁组合方法不足等问题,提出结合缺陷块、补丁优化和微调CodeBERT的MCRepair方法,在Defects4J上修复65个缺陷,性能较基线提升40%-250%。

摘要:

自动化程序修复(APR)是一种自动识别并修复程序缺陷的技术。然而,修复多块缺陷(multi-chunk bugs)仍是一个长期存在的挑战性问题,因为APR技术必须考虑各缺陷块间的依赖关系,同时还要缩小庞大的补丁空间。此外,尽管多块缺陷需要组合多个补丁,但目前关于如何组合单个候选补丁的研究仍十分有限。为此,我们提出了一种名为多代码修复(MCRepair)的新型APR技术,该技术结合缺陷块(buggy block)、补丁优化和CodeBERT来针对多块缺陷进行修复。缺陷块是一种将多个缺陷块绑定为一个多缺陷块,并结合其缺陷上下文对该块进行预处理的新方法,用于解决补丁空间缩减和依赖关系问题。补丁优化是一种能有效组合生成的候选补丁、同时缩减补丁空间的新策略。此外,我们对面向源代码数据集的BERT模型CodeBERT进行了微调,以解决数据集不足和词汇表外(OOV)问题。我们在Defects4J基准的6个项目模块上开展了多项实验以评估所提方法。在使用Defects4J的实验中,MCRepair修复了65个缺陷,其中包括21个多块缺陷。此外,它修复了18个独有缺陷,其中包括8个多块缺陷,性能相比基线方法提升了40%至250%。

英文摘要:

Automated program repair (APR) is a technology that identifies and repairs bugs automatically. However, repairing multi-chunk bugs remains a long-standing and challenging problem because an APR technique must consider dependencies and then reduce the large patch space. In addition, little is known about how to combine individual candidate patches even though multi-chunk bugs require combinations. Therefore, we propose a novel APR technique called multi-code repair (MCRepair), which applies a buggy block, patch optimization, and CodeBERT to target multi-chunk bugs. A buggy block is a novel method that binds buggy chunks into a multi-buggy chunk and preprocesses the chunk with its buggy contexts for patch space reduction and dependency problems. Patch optimization is a novel strategy that effectively combines the generated candidate patches with patch space reduction. In addition, CodeBERT, a BERT for source code datasets, is fine-tuned to address the lack of datasets and out-of-vocabulary problems. We conducted several experiments to evaluate our approach on six project modules of Defects4J. In the experiments using Defects4J, MCRepair repaired 65 bugs, including 21 multi-chunk bugs. Moreover, it fixed 18 unique bugs, including eight multi-chunk bugs, and improved 40 to 250 percent performance than the baselines.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑