Attention-Guided Graph Neural Networks with Adaptive Feature Selection for Explainable Software Defect Prediction
Keywords:
Software Defect Prediction, Graph Neural Networks, Attention Mechanisms, Explainable AI, Feature Selection, Graph Attention Networks, XAI, Software Engineering, Code Quality, Software Quality Assurance
Abstract
Software defect prediction plays a critical role in quality assurance, yet existing approaches face significant limitations in capturing complex inter-module dependencies while providing interpretable predictions essential for practical deployment. Traditional machine learning methods rely on handcrafted features that fail to model structural relationships within software systems, while recent deep learning approaches lack the explainability required for industrial adoption. This paper proposes an attention-guided graph neural network framework that integrates multi-algorithm feature selection with graph-based structural modeling to achieve superior defect prediction performance while maintaining comprehensive interpretability.Our framework combines five complementary feature selection methods (SHAP importance, permutation importance, CMA-ES optimization, Boruta selection, and mRMR analysis) to identify the most predictive software metrics, constructs similarity-based graphs to capture inter-module relationships, and employs multi-head Graph Attention Networks (GATv2) to learn defect patterns through attention mechanisms. The approach incorporates multi-modal explainability through attention weight visualization, LIME attributions, and feature importance analysis to provide actionable insights for software practitioners.Comprehensive evaluation on NASA PROMISE and GHPR datasets demonstrates substantial performance improvements, achieving mean F1-scores of 95.52% and 91.6% respectively, representing gains of 2.07% to 6.62% over state-of-the-art methods including CodeBERT, standard GAT, and traditional machine learning approaches. Ablation studies confirm that graph construction contributes most significantly to performance improvements (+3.55% F1), while feature importance analysis reveals that static invocations dominate modern defect patterns, providing specific architectural guidance for code quality improvement.The framework maintains computational efficiency suitable for continuous integration pipelines while scaling effectively from small projects to enterprise systems. Our contributions advance both theoretical understanding of software defect patterns through attention mechanism analysis and practical capabilities for industrial defect prediction through comprehensive explainability integration.
Published
2025-12-11
How to Cite
Shehadeh, H., Aljarrah, N. A., Obeidat, R. A., A. Abu-Ein, A., & Tawfik, M. (2025). Attention-Guided Graph Neural Networks with Adaptive Feature Selection for Explainable Software Defect Prediction. Statistics, Optimization & Information Computing. https://doi.org/10.19139/soic-2310-5070-2906
Issue
Section
Research Articles
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).