Identifying Root Cause of bugs by Capturing Changed Code Lines with Relational Graph Neural Networks
Jiaqi Zhang, Shikai Guo, Hui Li, Chenchen Li, Yu Chai, Rong Chen
TL;DR
RC-Detection addresses root-cause identification in bug-fixing commits for Just-In-Time defect prediction by modeling semantic relationships among changed code lines with a Relational Graph Convolutional Network. It introduces a graph type conversion step to unify heterogeneous graph data and a three-component pipeline (graph construction, conversion, and root-cause detection) that ranks candidate root-cause deletions with a RankNet-based layer. On data from $87$ open-source projects and $675$ bug-fix commits, it achieves $Recall@1=0.811$, $Recall@2=0.884$, $Recall@3=0.924$, and $MFR=1.830$, outperforming Neural-SZZ and other baselines by substantial margins. The work demonstrates that combining structural relationships and semantic content among changed lines improves root-cause detection and has practical implications for enhancing JIT defect prediction, with reproducible code and datasets provided for future research.
Abstract
The Just-In-Time defect prediction model helps development teams improve software quality and efficiency by assessing whether code changes submitted by developers are likely to introduce defects in real-time, allowing timely identification of potential issues during the commit stage. However, two main challenges exist in current work due to the reality that all deleted and added lines in bug-fixing commits may be related to the root cause of the introduced bug: 1) lack of effective integration of heterogeneous graph information, and 2) lack of semantic relationships between changed code lines. To address these challenges, we propose a method called RC-Detection, which utilizes relational graph convolutional network to capture the semantic relationships between changed code lines. RC-Detection is used to detect root-cause deletion lines in changed code lines, thereby identifying the root cause of introduced bugs in bug-fixing commits. To evaluate the effectiveness of RC-Detection, we used three datasets that contain high-quality bug-fixing and bug-introducing commits. Extensive experiments were conducted to evaluate the performance of our model by collecting data from 87 open-source projects, including 675 bug-fix commits. The experimental results show that, compared to the most advanced root cause detection methods, RC-Detection improved Recall@1, Recall@2, Recall@3, and MFR by at 4.107%, 5.113%, 4.289%, and 24.536%, respectively.
