A Three-Stage Based Ensemble Learning for Improved Software Fault Prediction: An Empirical Comparative Study

Chubato Wondaferaw Yohannese, Tianrui Li, Kamal Bashir

Abstract

Software Fault Prediction (SFP) is a critical component of modern software engineering, aimed at optimizing testing resources by identifying modules likely to contain defects. However, real-world software datasets are frequently compromised by redundant features, extreme class imbalance, and label noise. This paper introduces a systematic three-stage framework designed to address these data quality issues before applying ensemble learning models. By integrating Feature Selection (FS), Data Balancing (DB), and Noise Filtering (NF), the proposed approach significantly enhances prediction accuracy. Empirical results across 17 industry-standard datasets demonstrate that this staged preprocessing leads to substantial improvements in Area Under the Curve (AUC) and error reduction, with Random Forest emerging as the most effective ensemble learner.

Introduction

In large-scale software development, exhaustively testing every module is often infeasible. Software Fault Prediction (SFP) leverages machine learning to flag "fault-prone" modules, allowing engineers to focus their limited testing resources where they are most needed. Despite its potential, the practical application of SFP is often hindered by the poor quality of available datasets. These datasets typically suffer from three major hurdles: redundancy in software metrics, a severe lack of faulty examples (class imbalance), and mislabeled data (class noise).

While previous research has addressed these issues in isolation, this study argues that a combined, staged approach is necessary to handle the inherent complexity of software defect data. The authors propose a framework that systematically cleans the data to provide a robust foundation for ensemble learning algorithms.

Methodology: The Three-Stage Framework

The core of the research is a Three-Stage Based Ensemble Framework designed to refine the input data through successive cleaning steps.

The proposed three-stage ensemble learning framework for software fault prediction.

Stage 1: Feature Selection (FS)

Software metrics, such as lines of code or cyclomatic complexity, often overlap in the information they provide. Using Information Gain (IG), the framework identifies the most informative attributes and discards redundant ones. This reduction in dimensionality simplifies the model and accelerates the training process.

Stage 2: Data Balancing (DB)

Faulty modules are typically rare compared to healthy ones, leading standard algorithms to favor the majority class. To counter this, the framework employs the Synthetic Minority Over-sampling Technique (SMOTE). Unlike simple duplication, SMOTE generates new, synthetic faulty modules by interpolating between existing ones, achieving a more balanced 65:35 (Healthy:Faulty) ratio.

Stage 3: Noise Filtering (NF)

This stage addresses the "noise trap"—the risk that data balancing might amplify errors if synthetic samples are based on mislabeled data. The framework utilizes an Iterative Noise Filter based on the Fusion of Classifiers (INFFC). This method uses an ensemble of classifiers to vote on the validity of data points; consensus-identified noise is removed from the dataset.

Experimental Results

The study evaluated the framework using 17 publicly available NASA datasets from the PROMISE repository, testing 13 different Ensemble Learning Algorithms (ELAs), including Random Forest, AdaBoost, and Bagging.

Performance Gains

The impact of the staged approach was profound. In Stage 1 (Feature Selection only), the top-performing Random Forest model achieved an average AUC of 0.789. By the completion of Stage 3 (FS + DB + NF), the AUC rose to 0.986. Furthermore, the Root Mean Squared Error (RMSE) dropped significantly, indicating that the models became both more accurate and more confident in their predictions.

The Dominance of Random Forest

Across nearly all datasets and stages, Random Forest (RaF) consistently outperformed other ensemble methods. Its internal mechanism for handling feature subsets makes it particularly resilient to the specific challenges of software metrics.

Discussion and Conclusion

The findings underscore a critical insight: in software fault prediction, the quality of the data is as important as the sophistication of the learner. Sophisticated ensembles like Gradient Boosting still struggle if the input data is skewed or noisy. The proposed three-stage framework demonstrates that systematic preprocessing is not merely a preliminary step but a fundamental requirement for high-performance SFP.

Future work may involve hyperparameter tuning to further optimize the ensemble algorithms and the incorporation of "process metrics"—such as developer experience or change history—to complement static code metrics. For now, the three-stage approach provides a powerful template for engineers looking to clean up their code and their data.

Summary updated

BibTeX
@article{yohannese2018three,
  author = {Chubato Wondaferaw Yohannese and Tianrui Li and Kamal Bashir},
  title = {{A Three-Stage Based Ensemble Learning for Improved Software Fault Prediction: An Empirical Comparative Study}},
  journal = {Int. J. Comput. Intell. Syst.},
  year = {2018},
  doi = {10.2991/ijcis.11.1.92},
}
Figure