A Risk-Aware Stratified Undersampling Method for Imbalanced Software Defect Prediction

Software Defect Prediction (SDP) suffers from severe class imbalance, as defective samples typically account for less than 20% of the data, which often leads to biased model training and degraded prediction performance. Undersampling has been widely used to address class imbalance and improve prediction performance. However, existing undersampling methods may alter the original data distribution by removing majority-class samples, potentially displacing the learned decision boundary in real-world SDP scenarios. Therefore, this paper proposes a risk-aware undersampling method for Software Defect Prediction (RASU), which aims to alleviate class imbalance while reducing discrepancies between the retained and original majority-class distributions. The proposed method quantifies feature importance using SHAP values, incorporates defect distribution patterns to calculate a risk score for each majority-class sample, and performs proportional random sampling within decile-based risk strata. Experiments on 19 public datasets evaluate the proposed method. The results show that RASU achieves the highest average F1-score, MCC, and AUC under the decision-tree classifier and remains competitive under SVM and Random Forest. Ablation and controlled synthetic experiments indicate that the stratification mechanism can mitigate decision-boundary displacement under the evaluated settings.

Authors

Publication Details

Journal
International Journal of Software Engineering and Knowledge Engineering
Published
2026-10-28
DOI
https://doi.org/10.1142/s0218194027500021
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Risk-Aware Stratified Undersampling Method for Imbalanced Software Defect Prediction

X. J. Wang, Aoying Wang, Dan Wei, Bin Chen
1 links
International Journal of Software Engineering and Knowledge Engineering
Software Engineering Research
article

A Risk-Aware Stratified Undersampling Method for Imbalanced Software Defect Prediction

X. J. Wang, Aoying Wang, Dan Wei, Bin Chen
article en

Abstract

Software Defect Prediction (SDP) suffers from severe class imbalance, as defective samples typically account for less than 20% of the data, which often leads to biased model training and degraded prediction performance. Undersampling has been widely used to address class imbalance and improve prediction performance. However, existing undersampling methods may alter the original data distribution by removing majority-class samples, potentially displacing the learned decision boundary in real-world SDP scenarios. Therefore, this paper proposes a risk-aware undersampling method for Software Defect Prediction (RASU), which aims to alleviate class imbalance while reducing discrepancies between the retained and original majority-class distributions. The proposed method quantifies feature importance using SHAP values, incorporates defect distribution patterns to calculate a risk score for each majority-class sample, and performs proportional random sampling within decile-based risk strata. Experiments on 19 public datasets evaluate the proposed method. The results show that RASU achieves the highest average F1-score, MCC, and AUC under the decision-tree classifier and remains competitive under SVM and Random Forest. Ablation and controlled synthetic experiments indicate that the stratification mechanism can mitigate decision-boundary displacement under the evaluated settings.

International Journal of Software Engineering and Knowledge Engineering
Openalex Percentile: Top 6%
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.

Laika access coming soon
A Risk-Aware Stratified Undersampling Method for Imbalanced Software Defect Prediction — X. J. Wang, Aoying Wang, et al. · International Journal of Software Engineering and Knowledge Engineering (2026) | TGRS Research Map | TGRS