ABSTRACT Purpose Accurate software defect prediction (SDP) is critical to the success of any software project. Earlier studies have largely used static, semantic or structural features either in isolation or in pairs, offering a partial view of the source code. In reality, static features depict the statistical characteristics, semantic features depict the context and structural features depict data and control dependencies of the code. We propose a strong SDP model that integrates three types of features, achieving a holistic view of the source code, ultimately thereby enabling more robust and generalizable predictions. Methods First, the model extracts the static features from the open source PROMISE repository, semantic features from the Abstract Syntax Tree via CodeBERT followed by BiGRU and structural features from the Program Dependency Graph via Graph Convolutional Network. Second, feature alignment is performed for the fixed‐set representation of the three types of features using global attention pooling. Third, feature fusion is done for joint feature representation, followed by the application of additive attention to select the most suitable features. To handle the class imbalance scenario, cost‐sensitive gradient boosting is applied to penalize misclassifications more heavily. At last, the final feature set is fed to a classifier for defect prediction. Results Experiments conducted on eleven open source datasets reveal that the proposed unified feature representation approach achieves substantial performance improvements over the state‐of‐the‐art models. Moreover, the Wilcoxon signed‐rank test offers statistical validation for the relevance of these enhancements. Conclusion The integration of static, semantic and structural information results in a more holistic representation of source code, which substantially enhances defect prediction performance. The proposed approach addresses the partial view constraints of earlier approaches and offers strong potential for establishing a more reliable and robust SDP across various application domains.
Malhotra et al. (Sat,) studied this question.