MultiMend: 多语言程序修复与上下文增强及多补丁补丁生成
MultiMend: Multilingual Program Repair with Context Augmentation and Multi-Hunk Patch Generation
AI总结:
MultiMend通过上下文增强和多补丁生成技术,提升多语言程序修复效率,修复了2227个bug,其中1545个与开发者补丁一致,121个为多补丁bug。
摘要:
尽管测试和验证技术有所进步,软件调试仍是一个耗时费力的过程。基于学习的自动程序修复(APR)在减少手动修复bug的努力方面显示出潜力。然而,现有技术面临诸多挑战,包括语言依赖性策略、有限的bug上下文利用以及难以处理跨越多个位置的bug。本文提出了MultiMend,一种多语言学习的APR方法,旨在通过语言无关的上下文增强和多补丁补丁生成提高修复性能。MultiMend微调预训练的代码语言模型以生成bug修复补丁。它嵌入源代码行,并应用检索增强生成,在补丁生成过程中用相关行增强常规的功能性bug上下文。该方法还系统地构建多补丁bug的补丁,以扩展单补丁模型的能力并减少所需的补丁验证。我们评估了MultiMend在六个基准上的表现,涵盖四种编程语言的5,501个bug,并将其与最先进的方法进行比较。结果表明,MultiMend在修复2,227个bug方面表现竞争,其中1,545个与开发者补丁相同,121个为多补丁bug。上下文增强和多补丁补丁生成对这些结果有积极贡献。总体而言,MultiMend的贡献具有前景,并提供了实用有效的技术,以增强现实世界软件维护中的APR性能。
英文摘要:
Debugging software remains a labor-intensive and time-consuming process despite advances in testing and verification. Learning-based automated program repair (APR) has shown promise in reducing the effort of manually fixing bugs. However, existing techniques face several challenges, including language-dependent strategies, limited bug context utilization, and difficulties in handling bugs that span multiple locations in the code. This paper presents MultiMend, a multilingual learning-based APR approach designed to improve repair performance through language-independent context augmentation and multi-hunk patch generation. MultiMend fine-tunes a pre-trained code language model to generate bug-fixing patches. It embeds source code lines and applies retrieval-augmented generation to augment the usual function-based buggy context with relevant lines during patch generation. The approach also systematically constructs patches for multi-hunk bugs to extend the capabilities of single-hunk models and reduce the needed patch validations. We evaluate MultiMend on six benchmarks with 5,501 bugs covering four programming languages and compare it with state-of-the-art methods. Results show that MultiMend achieves competitive effectiveness and efficiency, fixing 2,227 bugs, of which 1,545 are identical to the developer's patch, and 121 are for multi-hunk bugs. Both context augmentation and multi-hunk patch generation contribute positively to these results. Overall, MultiMend's contributions are promising and offer practical and effective techniques to enhance APR performance for real-world software maintenance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。