一句话:提出 NEURALSZZ,用异构图注意力与学习排序识别修复提交中的根因删除行,提升 SZZ 精度。
SZZ 算法广泛用于识别引入缺陷的提交,但因 bug 修复提交中并非所有删除行都与修复相关,导致精度低。已有静态方法过滤注释、重构等噪声,但难以穷举模式,且未必提升性能。本文提出 NEURALSZZ,一种深度学习方法,先构建异构图注意力网络,建模每个删除行与其他删除/添加行之间的语义关系;再用学习排序对提交内所有删除行排序,定位根因删除行,并作为 SZZ 输入。作者在三个高质量 bug-fixing/bug-inducing 提交数据集上评估,结果显示 NEURALSZZ 优于传统机器学习和 Bi-LSTM 等基线;使用排序靠前的删除行后,SZZ 的精度和 F1 优于已有 SZZ 算法。
The SZZ algorithm has been widely used for identifying bug-inducing commits. However, it suffers from low precision, as not all deletion lines in the bug-fixing commit are related to the bug fix. Previous studies have attempted to address this issue by using static methods to filter out noise, e.g., comments and refactoring operations in the bug-fixing commit. However, these methods have two limitations. First, it is challenging to include all refactoring and non-essential change patterns in a tool, leading to the potential exclusion of relevant lines and the inclusion of irrelevant lines. Second, applying these tools might not always improve performance. In this paper, to address the aforementioned challenges, we propose NEURALSZZ, a deep learning approach for detecting the root cause deletion lines in a bug-fixing commit and using them as input for the SZZ algorithm. NEURALSZZ first constructs a heterogeneous graph attention network model that captures the semantic relationships between each deletion line and the other deletion and addition lines. To pinpoint the root cause of a bug, Neuralszz uses a learning-to-rank technique to rank all deletion lines in the commit. To evaluate the effectiveness of NEURALSZZ, we utilize three datasets containing high-quality bug-fixing and bug-inducing commits. The experiment results show that NEURALSZZ outperforms various baseline methods, e.g., traditional machine learning-based approaches and BI-LSTM in identifying the root cause of bugs. Moreover, by utilizing the top-ranked deletion lines and applying the SZZ algorithm, Neuralszz demonstrates better precision and F1-score compared to previous SZZ algorithms.