Software defect prediction with semantic and structural information of codes based on Graph Neural Networks

被引:23
|
作者
Zhou, Chunying [1 ]
He, Peng [1 ]
Zeng, Cheng [1 ]
Ma, Ju [1 ]
机构
[1] Hubei Univ, Sch Comp Sci & Informat Engn, Wuhan, Peoples R China
基金
国家重点研发计划;
关键词
Software defect prediction; Class Dependency Network; Convolutional Neural Network; Graph Convolutional Network;
D O I
10.1016/j.infsof.2022.107057
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Context: Most defect prediction methods consider a series of traditional manually designed static code metrics. However, only using these hand-crafted features is impractical. Some researchers use the Convolutional Neural Network (CNN) to capture the potential semantic information based on the program's Syntax Trees (ASTs). In recent years, leveraging the dependency relationships between software modules to construct a software network and using network embedding models to capture the structural information have been helpful in defect prediction. This paper simultaneously takes the semantic and structural information into account and proposes a method called CGCN. Objective: This study aims to validate the feasibility and performance of the proposed method in software defect prediction. Method: Abstract Syntax Trees and a Class Dependency Network (CDN) are first generated based on the source code. For ASTs, symbolic tokens are extracted and encoded into vectors. The numerical vectors are then used as input to the CNN to capture the semantic information. For CDN, a Graph Convolutional Network (GCN) is used to learn the structural information of the network automatically. Afterward, the learned semantic and structural information are combined with different weights. Finally, we concatenate the learned features with traditional hand-crafted features to train a classifier for more accurate defect prediction. Results: The proposed method outperforms the state-of-the-art defect prediction models for both within-project prediction (including within-version and cross-version) and cross-project prediction on 21 open-source projects. In general, within-version prediction achieves better performance in the three prediction tasks.Conclusion: The proposed method of combining semantic and structural information can improve the performance of software defect prediction.
引用
收藏
页数:20
相关论文
共 50 条
  • [1] Software Defect Prediction Using Neural Networks
    Jindal, Rajni
    Malhotra, Ruchika
    Jain, Abha
    2014 3RD INTERNATIONAL CONFERENCE ON RELIABILITY, INFOCOM TECHNOLOGIES AND OPTIMIZATION (ICRITO) (TRENDS AND FUTURE DIRECTIONS), 2014,
  • [2] An Approach to Semantic and Structural Features Learning for Software Defect Prediction
    Shi, Meilong
    He, Peng
    Xiao, Haitao
    Li, Huixin
    Zeng, Cheng
    MATHEMATICAL PROBLEMS IN ENGINEERING, 2020, 2020 (2020)
  • [3] Defect Prediction in Software Repositories with Artificial Neural Networks
    Bautista, Ana M.
    San Feliu, Tomas
    TRENDS AND APPLICATIONS IN SOFTWARE ENGINEERING, 2016, 405 : 165 - 174
  • [4] Research of Software Defect Prediction Model Based on Complex Network and Graph Neural Network
    Cui, Mengtian
    Long, Songlin
    Jiang, Yue
    Na, Xu
    ENTROPY, 2022, 24 (10)
  • [5] Software bug prediction using graph neural networks and graph-based text representations
    Siachos, Ilias
    Kanakaris, Nikos
    Karacapilidis, Nikos
    EXPERT SYSTEMS WITH APPLICATIONS, 2025, 259
  • [6] Graph based Neural Networks for Event Factuality Prediction using Syntactic and Semantic Structures
    Ben Veyseh, Amir Pouran
    Thien Huu Nguyen
    Dou, Dejing
    57TH ANNUAL MEETING OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS (ACL 2019), 2019, : 4393 - 4399
  • [7] Information Diffusion Prediction with Personalized Graph Neural Networks
    Wu, Yao
    Huang, Hong
    Jin, Hai
    KNOWLEDGE SCIENCE, ENGINEERING AND MANAGEMENT (KSEM 2020), PT II, 2020, 12275 : 376 - 387
  • [8] Investigating The Use of Deep Neural Networks for Software Defect Prediction
    Samir, Mohamed
    El-Ramly, Mohammad
    Kamel, Amr
    2019 IEEE/ACS 16TH INTERNATIONAL CONFERENCE ON COMPUTER SYSTEMS AND APPLICATIONS (AICCSA 2019), 2019,
  • [9] On the Effectiveness of Cost Sensitive Neural Networks for Software Defect Prediction
    Muthukumaran, K.
    Dasgupta, Amrita
    Abhidnya, Shirode
    Neti, Lalita Bhanu Murthy
    PROCEEDINGS OF THE EIGHTH INTERNATIONAL CONFERENCE ON SOFT COMPUTING AND PATTERN RECOGNITION (SOCPAR 2016), 2018, 614 : 557 - 570
  • [10] Mass spectra prediction with structural motif-based graph neural networks
    Park, Jiwon
    Jo, Jeonghee
    Yoon, Sungroh
    SCIENTIFIC REPORTS, 2024, 14 (01)