Fusion features for optimizing software defect detection using a graph neural network algorithm

In cross-project software defect detection, traditional methods struggle to accurately capture the complex structural relationships and dynamic evolution characteristics of code. This work proposes that constructing a dynamic heterogeneous graph model integrating multidimensional information enables a software defect detection system based on a Graph Neural Network (GNN) to significantly improve detection accuracy and cross-project generalization. To validate this hypothesis, a model named Dynamic Heterogeneous Graph Defect Detection (DGDefect) is designed and implemented. First, a dual-layer heterogeneous graph structure is built based on the Abstract Syntax Tree (AST) and the Program Dependence Graph (PDG). Additionally, a Dynamic Edge Weight Assignment (DEWA) algorithm is introduced to dynamically compute edge weights according to node attributes and contextual similarity. Next, a Gated Graph Attention Network performs gated fusion of syntactic features from AST nodes, control flow features from PDG nodes, and developer commit behavior features. A hierarchical attention mechanism-comprising node-level, subgraph-level, and global-level attention-is integrated within the GNN framework, along with a subgraph pattern matching strategy to identify defect propagation paths. Finally, a resilient incremental learning framework is developed, significantly enhancing model update efficiency through parameter freezing and knowledge distillation. Experiments conducted on the NASA software defect prediction dataset and three large-scale open-source industrial projects demonstrate that DGDefect achieves an average F1 score of 85.5% in cross-project detection, with 89.7% for Java projects. The false positive rate (FPR) is reduced to 5.8%, and recall reaches 88.1%. In industrial-scale codebase detection, the model achieves an average true defect detection rate of 93.1%. With only 52.7 million parameters, the model is significantly smaller than CodeBERT. These results confirm the proposed method's advantages in accuracy, efficiency, generalization, and practical applicability. This work offers a theoretically grounded and engineering-feasible solution for GNN-based software defect detection.

Authors

Institutions

Publication Details

Journal
Intelligent Decision Technologies
Published
2025-09-01
DOI
https://doi.org/10.1177/18724981251360514
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Fusion features for optimizing software defect detection using a graph neural network algorithm

Simin Cheng, Dandan Yi, Yuxiang Zhang, Siyu Wu
Intelligent Decision Technologies
Software Engineering Research
article

Fusion features for optimizing software defect detection using a graph neural network algorithm

Simin Cheng, Dandan Yi, Yuxiang Zhang, Siyu Wu
article en

Abstract

In cross-project software defect detection, traditional methods struggle to accurately capture the complex structural relationships and dynamic evolution characteristics of code. This work proposes that constructing a dynamic heterogeneous graph model integrating multidimensional information enables a software defect detection system based on a Graph Neural Network (GNN) to significantly improve detection accuracy and cross-project generalization. To validate this hypothesis, a model named Dynamic Heterogeneous Graph Defect Detection (DGDefect) is designed and implemented. First, a dual-layer heterogeneous graph structure is built based on the Abstract Syntax Tree (AST) and the Program Dependence Graph (PDG). Additionally, a Dynamic Edge Weight Assignment (DEWA) algorithm is introduced to dynamically compute edge weights according to node attributes and contextual similarity. Next, a Gated Graph Attention Network performs gated fusion of syntactic features from AST nodes, control flow features from PDG nodes, and developer commit behavior features. A hierarchical attention mechanism-comprising node-level, subgraph-level, and global-level attention-is integrated within the GNN framework, along with a subgraph pattern matching strategy to identify defect propagation paths. Finally, a resilient incremental learning framework is developed, significantly enhancing model update efficiency through parameter freezing and knowledge distillation. Experiments conducted on the NASA software defect prediction dataset and three large-scale open-source industrial projects demonstrate that DGDefect achieves an average F1 score of 85.5% in cross-project detection, with 89.7% for Java projects. The false positive rate (FPR) is reduced to 5.8%, and recall reaches 88.1%. In industrial-scale codebase detection, the model achieves an average true defect detection rate of 93.1%. With only 52.7 million parameters, the model is significantly smaller than CodeBERT. These results confirm the proposed method's advantages in accuracy, efficiency, generalization, and practical applicability. This work offers a theoretically grounded and engineering-feasible solution for GNN-based software defect detection.

Intelligent Decision TechnologiesVol. 19(5)
Soochow University (CN), First Affiliated Hospital of Soochow University (CN)
Openalex Percentile: Top 64%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.