We consider the problem of learning to repair programs from diagnostic feedback (e.g., compiler error messages). Program repair is challenging for two reasons: First, it requires reasoning and tracking symbols across source code and diagnostic feedback. Second, labeled datasets available for program repair are relatively small. In this work, we propose novel solutions to these two challenges. First, we introduce a program-feedback graph, which connects symbols relevant to program repair in source code and diagnostic feedback, and then apply a graph neural network on top to model the reasoning process. Second, we present a self-supervised learning paradigm for program repair that leverages unlabeled programs available online to create a large amount of extra program repair examples, which we use to pre-train our models. We evaluate our proposed approach on two applications: correcting introductory programming assignments (DeepFix dataset) and correcting the outputs of program synthesis (SPoC dataset). Our final system, DrRepair, significantly outperforms prior work, achieving 66.1% full repair rate on DeepFix (+20.8% over the prior best), and 48.0% synthesis success rate on SPoC (+3.3% over the prior best).
翻译:我们从诊断反馈(例如,编译错误信息)中考虑学习修补程序的问题。方案修补具有挑战性,原因有二:第一,它需要各种源代码和诊断反馈的推理和跟踪符号。第二,用于程序修理的标签数据集相对较少。在这项工作中,我们提出了解决这两个挑战的新办法。首先,我们引入了一个程序反馈图,将源代码和诊断反馈中与程序修理有关的符号连接起来,然后在顶端应用一个图形神经网络,以模拟推理过程。第二,我们提出了一个自监督的程序修补模式,利用在线的无标签程序创建大量额外的程序修补示例,我们用这些示例来预先培训我们的模型。我们评估了我们提出的两种应用方法:纠正介绍性编程任务(Depfix数据集)和纠正方案综合产出(SPoC数据集),我们的最后系统,DrRepair,大大超越了先前的工作,在DeepFix(+20.8%)上实现了66.1%的完全修补率,在SPoC+%之前的成功率上实现了48.03.3。