Software Fault Localization refers to the activity of finding code elements (e.g., statements) that are related to a software failure. The state-of-the-art fault localization techniques, however, produce coarse-grained results that can deter manual debugging or mislead automated repair tools. In this work, we focus specifically on the fine-grained identification of code elements (i.e., tokens) that must be changed to fix a buggy program: we refer to it as fix localization. This paper introduces a neural network architecture (named Beep) that builds on AST paths to predict the buggy code element as well as the change action that must be applied to repair a program. Leveraging massive data of bugs and patches within the CoCoNut dataset, we trained a model that was (1) effective in localizing the buggy tokens with the Mean First Rank significantly higher than a statistics based baseline and a machine learning-based baseline, and (2) effective in predicting the repair operators (with the associated buggy code elements) with a Recall@1= 30-45% and the Mean First Rank=7-12 (evaluated by CoCoNut, ManySStuBs4J, and Defects4J datasets). To showcase how fine-grained fix localization can help program repair, we employ it in two repair pipelines where we use either a code completion engine to predict the correct token or a set of heuristics to search for the suitable donor code. A key strength of accurate fix localization for program repair is that it reduces the chance of patch overfitting, a challenge in generate-and-validate automated program repair: both two repair pipelines achieve a correctness ratio of 100%, i.e., all generated patches are found to be correct. Moreover, accurate fix localization helps enhance the efficiency of program repair.
翻译:软件“ 错误” 本地化指的是查找与软件故障相关的代码元素的活动( 例如, 语句 ) 。 然而, 最先进的输油管本地化技术可以产生粗粗的读取结果, 可以阻遏手动调试或误导自动修理工具 。 在这项工作中, 我们特别侧重于精细的识别代码元素( 例如, 符号 ), 这必须修改以修正一个错误程序: 我们把它称为固定本地化 。 本文引入一个神经网络结构( 名为 Beep ), 以 AST 路径为基础, 预测错误代码元素, 以及必须用于修复程序的变异性化操作 。 在 CooNut 数据集中, 我们使用大量错误和补版数据数据数据数据, 我们专门开发了一个错误符号的本地化程序 。 在基于统计的基线和基于机器学习的基线上, 以及 (2) 有效预测修复操作者( 与相关的错误代码搜索功能), 用于Recall@ 1- 45 % 和 Birdeal 的正确化程序, 正在建立一个本地化程序。