
Software defect prediction (SDP) is a critical proactivemethodology in modern software engineering, allowingdevelopment teams to allocate testing resources efficiently byidentifying fault-prone modules. However, the inherent class imbalancein software repositories where clean code vastly outnumbersdefective code severely limits the reliability of traditionalclassification models, a phenomenon known as the AccuracyParadox. This study presents a comparative analysis of three treebasedmachine learning architectures: a baseline Decision Tree,a bagging ensemble (Random Forest), and a boosting ensemble(XGBoost), to evaluate their robustness against imbalancedstatic code metrics. Utilizing the NASA MDP JM1 dataset, themethodology incorporates the Synthetic Minority Over-samplingTechnique (SMOTE) to balance the training space. Performancewas evaluated using Accuracy, Precision, Recall, F1-Score, andROC-AUC. The empirical results confirm the Accuracy Paradox:while XGBoost achieved the highest global accuracy (80.15%),it exhibited the lowest recall (31.03%), missing a critical volumeof actual defects. Conversely, the Random Forest model provedsuperior in navigating the noisy feature space, achieving thehighest F1-Score (0.4187) and ROC-AUC (0.7472). The findingsdemonstrate that for static software metric analysis, variancereduction through bootstrap aggregating provides a more reliablepredictive threshold than sequential error correction.
