Comparative Analysis of Machine Learning Models for Software Defect Prediction
Sai Krishna Gunda
Abstract
Background: Software defect prediction is a critical aspect of software engineering, allowing the prediction and diagnosis of defects before deployment to enhance software quality and reliability. Methods: This study employs machine learning techniques to develop a comprehensive solution for software fault prediction. The research begins with data preparation and preprocessing, which includes addressing missing values, encoding categorical variables, and splitting the dataset into training and testing sets. Three machine learning models—Decision Trees, K-Nearest Neighbors (KNN), and Logistic Regression—are then trained on the processed dataset. Results: The performance of these models is evaluated using accuracy, F1 score, recall, precision, and Jaccard index metrics. Logistic Regression achieves an accuracy of 0.7691, an F1 score of 0.1823, a recall of 0.1596, a precision of 0.2125, and a Jaccard index of 0.1002. K-Nearest Neighbors records an accuracy of 0.8266, an F1 score of 0.2237, a recall of 0.1549, a precision of 0.4024, and a Jaccard index of 0.1259. Decision Trees exhibit an accuracy of 0.8191, an F1 score of 0.4039, a recall of 0.3802, a precision of 0.4308, and a Jaccard index of 0.2531. Concluding Remarks: The findings highlight that Logistic Regression performs best in terms of accuracy, while Decision Trees excel in F1 score and precision. These insights emphasize the importance of careful model selection and evaluation criteria in optimizing software defect prediction systems. This study provides valuable guidelines for developers and researchers looking to integrate machine learning techniques into software defect prediction processes.