Skip to content
Conference

Explainable Machine Learning for Software Defect Prediction Using Random Forest and XGBoost

Sep 2026 · International Conference on Communications and Information Technology · pp. 1-6 · 0 citations · 26 references

Abstract

Software defect prediction plays a critical role in quality assurance by identifying fault-prone modules prior to system deployment. Conventional tree-based machine learning approaches often operate as black boxes, making it difficult for software engineering teams to understand the key code attributes driving predictions. This study evaluates an explainable defect prediction framework that compares Random Forest and XGBoost classifiers on static code metrics while evaluating model transparency through Explainable Artificial Intelligence. Models were trained and optimized using Python, scikit-learn, and XGBoost on the NASA MDP KC1 dataset, comprising 2109 C++ software modules with 21 static metrics under a 5.47 to 1 class imbalance. Hyperparameter optimization was conducted using RandomizedSearchCV with 5-fold stratified cross-validation on an 80 to 20 stratified train-test split. On the test set, Random Forest achieved an accuracy of 0.7037, precision of 0.4151, recall of 0.3492, F1-score of 0.3793, and ROC-AUC of 0.6089. XGBoost achieved an accuracy of 0.6173, precision of 0.3295, recall of 0.4603, F1-score of 0.3841, and ROC-AUC of 0.6026. McNemar testing revealed significant prediction disagreement between models with a chi-squared value of 8.8889 and p-value of 0.0029, while tree-based SHAP analysis demonstrated moderate global rank agreement with a Spearman correlation coefficient of 0.570. Random Forest prioritized Halstead Volume whereas XGBoost prioritized Halstead Difficulty. Software engineering practitioners can integrate these explainable ensemble workflows into continuous integration pipelines to prioritize high-risk code modules for targeted refactoring and code review.

View source

Similar papers

Open access Oct 2026

Predictive Analytics for Software Reliability: Integrating Software Metrics with Automated Model Search for Quality Assurance Optimization

Predicting software reliability is important but difficult: traditional statistical models and manually tuned ML approaches fail to express nonlinearities present in modern software and often demand extensive human domain knowledge. We evaluate an end-to-end automated hyperparameter search pipeline of RF, GB, and SVM c...

R. Syed, Arvind Pandey · 0 citations
Open access Oct 2026

An Explainable Artificial Intelligence Framework for Automated Software Defect Prediction and Quality Assurance in Large-Scale Software Systems

The increasing complexity of large-scale software systems has intensified the need for automated techniques capable of identifying defect-prone modules and supporting efficient software quality assurance. Conventional software defect prediction techniques frequently emphasize classification accuracy while providing lim...

Dipannita Mondal · 0 citations
Open access Oct 2026

X‐GNN for Interpretable Class‐Level Software Defect Prediction: An Empirical Study on Defects4J

Software defect prediction supports targeted quality assurance by identifying modules that warrant early testing and maintenance attention. This study presents an Explainable Graph Neural Network (X‐GNN) framework for class‐level defect prediction, in which software versions are modeled as directed dependency graph...

Muhammad Saqib, Ijazul Haq, Ibrar Ali Shah et al. · 0 citations
Open access Oct 2026

Explainable AI for Software Reliability: A Three-Dataset Benchmark of Defect, Incident-Severity and Change-Failure Prediction

In this study, three software reliability tasks are considered: predicting defect prone modules, software incidents severity classification, and predicting deployment change failures, and explainable artificial intelligence (XAI) is studied for those tasks. For four explicitly synthetic tabular datasets with 2,400 data...

Weam Mohammed Kraidi Mail, Wasan Fathi Tayeh · 0 citations
Open access 2026

Integrating Explainable Artificial Intelligence into Software Defect Prediction: Addressing the Black Box Challenge

: Software Defect Prediction (SDP) plays a critical role in improving software quality by identifying fault-prone modules early in the development lifecycle. While machine learning models (particularly black-box) have demonstrated high predictive accuracy, their lack of interpretability limits their adoption in environ...

Miriam Ramírez-Zárate, Á. Sánchez-García, L. A. Hernández-González et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.