Enhance Expert‐Semantic Feature Extraction and Combine Feature Importance and Attention Scores for Just‐in‐Time Defect Prediction and Localization.

Saved in:
Bibliographic Details
Title: Enhance Expert‐Semantic Feature Extraction and Combine Feature Importance and Attention Scores for Just‐in‐Time Defect Prediction and Localization.
Authors: Zhao, Yu1 (AUTHOR), Yuan, Xinyu1 (AUTHOR), Gong, Lina1 (AUTHOR) gonglina@nuaa.edu.cn, Huang, Zhiqiu1 (AUTHOR) zqhuang@nuaa.edu.cn
Source: Journal of Software: Evolution & Process. May2026, Vol. 38 Issue 5, p1-19. 19p.
Subjects: Feature extraction, Defect tracking (Computer software development), Artificial neural networks
Abstract: Fine‐grained defect prediction and localization techniques that conform to frontline code development scenarios, that is, just‐in‐time software defect prediction and localization (JIT‐SDP and JIT‐SDL), have recently attracted widespread attention. A newly proposed state‐of‐the‐art unified just‐in‐time defect prediction and localization model has shown significant advantages over the two‐stage model in terms of resource consumption and actual performance. However, the existing unified model still ignores the handling of class imbalance and class overlap in the original dataset and does not fully utilize the power of the fusion representation of expert features and semantic features. Additionally, they rely on controversial attention‐based methods for locating code lines. Therefore, this paper proposes to establish a unified model for just‐in‐time defect prediction and localization by enhancing expert and semantic feature extraction and combining feature importance scores and attention scores (JITEC). Specifically, we first adopt a hybrid resampling method to address class imbalance and class overlap, which prevents bias toward clean commits and improves the distinction between defective and clean commits. Then, for code commit information, we further use the recurrent neural network (RNN) and the convolutional neural network (CNN) to perform deeper feature extraction and fusion based on expert features extracted by expert metrics and semantic features extracted by CodeBERT, which could improve the model's ability to recognize defect patterns and the JIT‐SDP performance. Finally, we ranked the risk of code lines in the commit changes by combining two complementary signals: the token attention scores from CodeBERT, which highlight code tokens most relevant to the model's prediction, and the feature importance scores from the local interpretable model‐agnostic explanations (LIME) method, which explain which features drive the model's decision. To evaluate the effectiveness of the designed JITEC method, we conducted large‐scale experiments on JIT‐Defects4J, a high‐quality line‐level manually labeled dataset containing 21 real Java open‐source projects, and conducted thorough experimental evaluations on prediction and localization tasks using effort‐agnostic and effort‐aware performance evaluation metrics. The experimental results show that each of the designed processing modules improves the performance of JIT‐SDP and the model trained by combining all processing modules has a synergistic effect on the prediction task. The final unified model surpasses all state‐of‐the‐art baselines in multiple metrics of just‐in‐time prediction and localization tasks. [ABSTRACT FROM AUTHOR]
Copyright of Journal of Software: Evolution & Process is the property of Wiley-Blackwell and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)
Database: Engineering Source
Description
Abstract:Fine‐grained defect prediction and localization techniques that conform to frontline code development scenarios, that is, just‐in‐time software defect prediction and localization (JIT‐SDP and JIT‐SDL), have recently attracted widespread attention. A newly proposed state‐of‐the‐art unified just‐in‐time defect prediction and localization model has shown significant advantages over the two‐stage model in terms of resource consumption and actual performance. However, the existing unified model still ignores the handling of class imbalance and class overlap in the original dataset and does not fully utilize the power of the fusion representation of expert features and semantic features. Additionally, they rely on controversial attention‐based methods for locating code lines. Therefore, this paper proposes to establish a unified model for just‐in‐time defect prediction and localization by enhancing expert and semantic feature extraction and combining feature importance scores and attention scores (JITEC). Specifically, we first adopt a hybrid resampling method to address class imbalance and class overlap, which prevents bias toward clean commits and improves the distinction between defective and clean commits. Then, for code commit information, we further use the recurrent neural network (RNN) and the convolutional neural network (CNN) to perform deeper feature extraction and fusion based on expert features extracted by expert metrics and semantic features extracted by CodeBERT, which could improve the model's ability to recognize defect patterns and the JIT‐SDP performance. Finally, we ranked the risk of code lines in the commit changes by combining two complementary signals: the token attention scores from CodeBERT, which highlight code tokens most relevant to the model's prediction, and the feature importance scores from the local interpretable model‐agnostic explanations (LIME) method, which explain which features drive the model's decision. To evaluate the effectiveness of the designed JITEC method, we conducted large‐scale experiments on JIT‐Defects4J, a high‐quality line‐level manually labeled dataset containing 21 real Java open‐source projects, and conducted thorough experimental evaluations on prediction and localization tasks using effort‐agnostic and effort‐aware performance evaluation metrics. The experimental results show that each of the designed processing modules improves the performance of JIT‐SDP and the model trained by combining all processing modules has a synergistic effect on the prediction task. The final unified model surpasses all state‐of‐the‐art baselines in multiple metrics of just‐in‐time prediction and localization tasks. [ABSTRACT FROM AUTHOR]
ISSN:20477473
DOI:10.1002/smr.70118