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

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.

Authors

Institutions

Publication Details

Journal
Journal of Software Evolution and Process
Published
2026-05-01
DOI
https://doi.org/10.1002/smr.70118
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Xinyu Yuan, Yu Zhao, Lina Gong, Zhiqiu Huang
Journal of Software Evolution and Process
Software Engineering Research
article

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

Xinyu Yuan, Yu Zhao, Lina Gong, Zhiqiu Huang
article en

Abstract

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.

Journal of Software Evolution and ProcessVol. 38(5)
Nanjing University of Aeronautics and Astronautics (CN)
National Natural Science Foundation of China, Nanjing University of Aeronautics and Astronautics, Natural Science Foundation of Jiangsu Province, Nanjing University
Decent work and economic growth
Openalex Percentile: Top 3%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.