Answers are grounded in this paper and cite their sources.
Software defect prediction (SDP) endeavours to forecast defects in a project during its early stages by using data from the current or previous versions. An essential challenge in SDP is the effective integration of comprehensive code information, such as dependencies between files and structural information, to form optimal feature representations for SDP. To tackle this issue, we propose a hierarchical SDP model based on graph neural networks, which consists of two layers: file‐ and program‐level, which integrate the software information of both the file and program‐level graph representations (FPGR). In this setup, we utilize the code features obtained from the file‐level GNN as the initial node features for the program‐level GAT. This effectively addresses the issue in previous methods where static or structural features used as initial node features were insufficient for representing defect information, resulting in poor prediction performance. Subsequently, a project‐level defect‐aware graph attention network fuses interclass dependency information, comprehensively mining different levels of software representation graphs to construct superior feature representations. The defect‐aware graph attention network assigns differentiated weights to nodes of different categories during message passing, introducing a category weighting mechanism to mitigate the negative impact of class imbalance and the ‘homophily assumption’ in graph neural networks. Our experiments, conducted on 14 open‐source projects, reveal that FPGR performs better in within‐version SDP tasks, and our enhancements have indeed improved the model's performance to some extent. However, our performance in cross‐version SDP is not particularly satisfactory, although it is comparable to existing methods. We also discuss the impact of the hyperparameter and observe its influence on the model's ability to classify defective files.
No takes yet. Share an insight, caveat, or question.
Zhou et al. (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: