{"title":"GLA-SDP:一种基于GCN和LSTM的基于注意力的语义和静态特征融合的软件缺陷预测方法","authors":"Haining Meng , Han Wu , Xiaoqing Li , Xinhong Hei","doi":"10.1016/j.jss.2025.112630","DOIUrl":null,"url":null,"abstract":"<div><div>Software defect prediction (SDP) is crucial for improving software quality and optimizing resource allocation by identifying potential defects at early development stages. Traditional SDP methods rely on manually crafted static features, which often fail to capture the semantic and contextual information in code. Recent advances using abstract syntax trees (ASTs) have improved semantic feature extraction, yet they often neglect structural dependencies and lack effective integration with static features. To address these limitations, this study proposes GLA-SDP, a novel defect prediction model that fuses features through the integration of Graph Convolutional Networks (GCNs), Long Short-Term Memory (LSTM) networks, and an additive attention fusion mechanism. Specifically, a recursive AST-to-graph construction method is designed to extract rich semantic features using GCNs, while LSTMs are employed to capture sequential patterns from static code metrics. Furthermore, an attention-based fusion mechanism dynamically weight and combine semantic and static features, preserving their complementary importance in defect prediction. Extensive experiments on eight Java projects from the PROMISE dataset and four C-language projects from the Devign dataset demonstrate that GLA-SDP consistently outperforms state-of-the-art baselines, achieving average improvements of 37 % in F1-score and 24 % in MCC. These results highlight the superior accuracy and practical applicability of the proposed approach.</div></div>","PeriodicalId":51099,"journal":{"name":"Journal of Systems and Software","volume":"231 ","pages":"Article 112630"},"PeriodicalIF":4.1000,"publicationDate":"2025-09-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"GLA-SDP: A novel attention-based semantic and static feature fusion method using GCN and LSTM for software defect prediction\",\"authors\":\"Haining Meng , Han Wu , Xiaoqing Li , Xinhong Hei\",\"doi\":\"10.1016/j.jss.2025.112630\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><div>Software defect prediction (SDP) is crucial for improving software quality and optimizing resource allocation by identifying potential defects at early development stages. Traditional SDP methods rely on manually crafted static features, which often fail to capture the semantic and contextual information in code. Recent advances using abstract syntax trees (ASTs) have improved semantic feature extraction, yet they often neglect structural dependencies and lack effective integration with static features. To address these limitations, this study proposes GLA-SDP, a novel defect prediction model that fuses features through the integration of Graph Convolutional Networks (GCNs), Long Short-Term Memory (LSTM) networks, and an additive attention fusion mechanism. Specifically, a recursive AST-to-graph construction method is designed to extract rich semantic features using GCNs, while LSTMs are employed to capture sequential patterns from static code metrics. Furthermore, an attention-based fusion mechanism dynamically weight and combine semantic and static features, preserving their complementary importance in defect prediction. Extensive experiments on eight Java projects from the PROMISE dataset and four C-language projects from the Devign dataset demonstrate that GLA-SDP consistently outperforms state-of-the-art baselines, achieving average improvements of 37 % in F1-score and 24 % in MCC. These results highlight the superior accuracy and practical applicability of the proposed approach.</div></div>\",\"PeriodicalId\":51099,\"journal\":{\"name\":\"Journal of Systems and Software\",\"volume\":\"231 \",\"pages\":\"Article 112630\"},\"PeriodicalIF\":4.1000,\"publicationDate\":\"2025-09-12\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Systems and Software\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S0164121225002997\",\"RegionNum\":2,\"RegionCategory\":\"计算机科学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q1\",\"JCRName\":\"COMPUTER SCIENCE, SOFTWARE ENGINEERING\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Systems and Software","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0164121225002997","RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
GLA-SDP: A novel attention-based semantic and static feature fusion method using GCN and LSTM for software defect prediction
Software defect prediction (SDP) is crucial for improving software quality and optimizing resource allocation by identifying potential defects at early development stages. Traditional SDP methods rely on manually crafted static features, which often fail to capture the semantic and contextual information in code. Recent advances using abstract syntax trees (ASTs) have improved semantic feature extraction, yet they often neglect structural dependencies and lack effective integration with static features. To address these limitations, this study proposes GLA-SDP, a novel defect prediction model that fuses features through the integration of Graph Convolutional Networks (GCNs), Long Short-Term Memory (LSTM) networks, and an additive attention fusion mechanism. Specifically, a recursive AST-to-graph construction method is designed to extract rich semantic features using GCNs, while LSTMs are employed to capture sequential patterns from static code metrics. Furthermore, an attention-based fusion mechanism dynamically weight and combine semantic and static features, preserving their complementary importance in defect prediction. Extensive experiments on eight Java projects from the PROMISE dataset and four C-language projects from the Devign dataset demonstrate that GLA-SDP consistently outperforms state-of-the-art baselines, achieving average improvements of 37 % in F1-score and 24 % in MCC. These results highlight the superior accuracy and practical applicability of the proposed approach.
期刊介绍:
The Journal of Systems and Software publishes papers covering all aspects of software engineering and related hardware-software-systems issues. All articles should include a validation of the idea presented, e.g. through case studies, experiments, or systematic comparisons with other approaches already in practice. Topics of interest include, but are not limited to:
•Methods and tools for, and empirical studies on, software requirements, design, architecture, verification and validation, maintenance and evolution
•Agile, model-driven, service-oriented, open source and global software development
•Approaches for mobile, multiprocessing, real-time, distributed, cloud-based, dependable and virtualized systems
•Human factors and management concerns of software development
•Data management and big data issues of software systems
•Metrics and evaluation, data mining of software development resources
•Business and economic aspects of software development processes
The journal welcomes state-of-the-art surveys and reports of practical experience for all of these topics.