Introduction
Software Fault Prediction (SFP) is a cornerstone of modern software engineering, enabling development teams to prioritize testing and maintenance for the most "bug-prone" modules. Despite its importance, SFP faces two significant challenges: the presence of redundant software metrics (feature overload) and the inherent scarcity of faulty modules in high-quality systems (class imbalance). This paper proposes a combined-learning framework that integrates feature selection and data balancing to enhance prediction accuracy across diverse software environments.
Problem Statement
The effectiveness of SFP models is often hindered by two primary factors:
- Feature Overload: Modern software projects are characterized by a vast array of metrics, from lines of code to complex object-oriented dependencies. Many of these metrics are redundant or irrelevant, introducing noise that degrades model performance.
- Class Imbalance: In well-maintained software, faulty modules are rare compared to non-faulty ones. Standard machine learning algorithms often fail to learn the characteristics of the minority (faulty) class, leading to poor predictive power for actual defects.
Methodology
The proposed framework employs a systematic "combined-learning" approach across three distinct strategies. The core process involves pruning irrelevant features and then balancing the resulting dataset to optimize classifier performance.
Modeling Strategies
The authors evaluated the impact of different preprocessing steps:
- Strategy One (Baseline): Modeling is performed directly on individual metric sets without advanced preprocessing.
- Strategy Two (Feature Selection): Incorporates techniques to identify the most predictive attributes, reducing noise.
- Strategy Three (Combined Learning): Pairs feature selection with data balancing to address both noise and class imbalance simultaneously.
Components of the Framework
- Classifiers: Eight diverse algorithms were tested: Naïve Bayes (NB), Neural Networks (NN), Support Vector Machines (SVM), Random Forest (RF), K-Nearest Neighbor (KNN), Decision Table (DTa), Decision Tree (DTr), and Random Tree (RTr).
- Feature Selection (FS): Three methods were utilized: Correlation-Based Feature Selection (CFS), Principal Components Analysis (PCA), and Information Gain (IG).
- Data Balancing (DB): The Synthetic Minority Oversampling Technique (SMOTE) was used to achieve a balanced 65/35 ratio of non-faulty to faulty modules.
Datasets
The study leveraged six datasets from the PROMISE repository and other public sources, covering various metric types:
- Static Code Metrics (SCM):
mc1andjm1(McCabe and Halstead complexity). - Object Oriented Metrics (OOM):
prop-4andcamel-1.6(Chidamber and Kemerer metrics). - Combined Metrics:
AEEEM MLandLCdatasets, integrating object-oriented, churn, and entropy measures.
Results and Discussion
The experimental results highlight several key insights:
- Context-Dependent Feature Selection: No single feature selection method is universally superior. Information Gain (IG) performed best for traditional Static Code Metrics, while Correlation-Based Selection (CFS) was more effective for Object-Oriented Metrics.
- The Synergy of Balancing: While feature selection alone can sometimes exclude rare but critical data points, combining it with SMOTE-based data balancing consistently yields robust and high-accuracy models.
- Classifier Performance: Random Forest (RF) emerged as the most stable and high-performing classifier when integrated into the combined-learning framework. For SCM, the RF + IG + SMOTE combination achieved an AUC-ROC of 0.993. For OOM, the RF + CFS + SMOTE combination reached an AUC-ROC of 0.909.
Conclusion
The proposed combined-learning framework significantly improves software fault prediction by addressing feature redundancy and class imbalance. Future work will focus on hyperparameter optimization, the inclusion of process metrics (e.g., developer experience), and exploring cross-project fault prediction to enhance the generalizability of the models.
Summary updated