Automated software debugging is a crucial task for improving the productivity of software developers. Many neural-based techniques have been proven effective for debugging-related tasks such as bug localization and program repair (or bug fixing). However, these techniques often focus only on either one of them or approach them in a stage-wise manner, ignoring the mutual benefits between them. In this work, we propose a novel unified \emph{Detect-Localize-Repair} framework based on a pretrained programming language model CodeT5 to seamlessly address these tasks, named CodeT5-DLR. Specifically, we propose three objectives to adapt the generic CodeT5 for debugging: a bug detection objective to determine whether a given code snippet is buggy or not, a bug localization objective to identify the buggy lines, and a program repair objective to translate the buggy code to its fixed version. We evaluate it on each of these tasks and their combined setting on two newly collected line-level debugging datasets in Java and Python. Extensive results show that our model significantly outperforms existing baselines from both NLP and software engineering domains.
翻译:自动化软件调试是提高软件开发者生产率的关键任务。 许多基于神经的技术已被证明对调试相关任务有效, 如错误定位和程序修理( 或错误修正 ) 。 但是, 这些技术往往只关注其中之一, 或以分阶段的方式接近它们, 忽视它们之间的相互利益 。 在这项工作中, 我们提议了一个基于预先培训的编程语言模式代码代码5 的统一程序修正框架, 以无缝地完成这些任务, 名为代码T5- DLR 。 具体地说, 我们提出了三个修改通用代码T5 用于调试的目标 : 用于确定给定的代码片断是否为错误的错误检测目标, 用于识别错误线的错误定位目标, 以及 将错误代码转换为固定版本的程序修正目标 。 我们对这些任务中的每一项任务进行了评估, 并结合了两个在爪哇和 Python 中新收集的线级调试的数据集。 广泛的结果显示, 我们的模型大大超越了 NLP 和软件工程域的现有基线 。