A novel feature selection method based on maximum likelihood logistic regression for imbalanced learning in software defect prediction

Kamal Bashir, Tianrui Li, Mahama Yahaya

Abstract

Software defect prediction (SDP) is a critical task in software engineering, aimed at identifying buggy modules early in the development lifecycle. However, the effectiveness of SDP is often hindered by high-dimensional datasets containing redundant features and severe class imbalance, where defective modules are significantly outnumbered by healthy ones. This paper proposes a novel feature selection method, Maximum Likelihood Logistic Regression (MLLR), which utilizes the Wald test to identify statistically significant predictors. When integrated with the Synthetic Minority Oversampling Technique (SMOTE) and Random Forest classifiers, MLLR demonstrates superior predictive performance compared to traditional feature selection techniques.

Introduction: The Challenge of Imbalanced Software Data

Software defects represent a significant financial burden on the industry. While machine learning offers a path to automated defect prediction, two primary obstacles persist: high dimensionality and class imbalance. Many software metrics are redundant or noisy, which can degrade model performance. Furthermore, real-world datasets are typically skewed, leading models to favor the majority (non-defective) class. Existing feature selection methods, such as Chi-Square or Information Gain, often fail to identify the most relevant features in these complex, imbalanced environments.

Methodology: The MLLR Framework

The proposed approach centers on the MLLR (Maximum Likelihood Logistic Regression) feature selection method. Unlike standard filter methods that rank features based on individual scores, MLLR is an embedded approach that evaluates features within a statistical model.

Workflow of the proposed SDP framework integrating SMOTE and MLLR

The MLLR Approach

The MLLR method fits a logistic regression model to the training data. It then applies the Wald test to the resulting coefficients. Features are retained only if their coefficients are significantly different from zero at a 95% confidence interval. This ensures that only mathematically rigorous, statistically reliable predictors are used for the final model.

Data Balancing and Classification

To address class imbalance, the researchers employed SMOTE (Synthetic Minority Oversampling Technique) to generate synthetic examples of defective modules. The study explored different balancing ratios (35:65 and 50:50). These balanced datasets were then used to train two types of learners: Support Vector Machines (SVM) and Random Forest (RaF).

Experimental Setup

The study evaluated the MLLR method using six public software datasets from the Promise repository: PC1, Tomcat, ML, PDE, LC, and JDT. These datasets vary in size from approximately 700 to 1,800 modules, with natural defect ratios ranging from 3.8% to 10.5%. Performance was primarily measured using the Area Under the ROC Curve (AUC), and results were validated using ANOVA F-tests to ensure statistical significance.

Key Results and Discussion

The experimental results consistently highlighted the superiority of the MLLR method across various scenarios.

Performance Gains

MLLR outperformed traditional feature selection methods like Chi-Square (CS), Information Gain (IG), and Relief (RF) in nearly every test case. One of the most significant findings was the synergy between data balancing and feature selection. As datasets moved toward a 50:50 balance, the effectiveness of MLLR in identifying the most predictive features increased substantially.

AUC performance comparison for Case-B (50:50) using Random Forest

As shown in the figure above, the MLLR method achieved the highest AUC (0.978 in Case-B) when paired with a Random Forest classifier on a balanced dataset. This combination consistently yielded the best results, often outperforming SVM-based models. For specific datasets like PC1, the MLLR + Random Forest combo achieved AUC scores as high as 0.989.

Model Efficiency

While using the full set of features sometimes produced high raw scores, the MLLR-reduced models achieved comparable performance with significantly lower complexity. This reduction in dimensionality makes the models more practical for real-world deployment where computational efficiency is a concern.

Conclusion

The MLLR feature selection method provides a robust, statistically grounded approach to software defect prediction. By filtering features through the Wald test and addressing class imbalance via SMOTE, the proposed framework significantly improves the detection of defective modules. Future work will involve testing MLLR against a broader range of software metrics and exploring alternative sampling techniques to further enhance predictive accuracy.

Summary updated

BibTeX
@article{bashir2020novel,
  author = {Kamal Bashir and Tianrui Li and Mahama Yahaya},
  title = {{A novel feature selection method based on maximum likelihood logistic regression for imbalanced learning in software defect prediction}},
  journal = {Int. Arab J. Inf. Technol.},
  year = {2020},
  doi = {10.34028/iajit/17/5/5},
}
Figure