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 条
  • [21] A Software Defect Prediction Method Based on Program Semantic Feature Mining
    Yao, Wenjun
    Shafiq, Muhammad
    Lin, Xiaoxin
    Yu, Xiang
    ELECTRONICS, 2023, 12 (07)
  • [22] RBF Neural Networks Design with Graph Based Structural Information from Dominating Sets
    Marcelo Queiroz
    Frederico Coelho
    Luiz C. B. Torres
    Felipe V. Campos
    Gabriel Lara
    Wagner Alvarenga
    Antônio de Pádua Braga
    Neural Processing Letters, 2023, 55 : 4719 - 4733
  • [23] Graph Neural Networks and Structural Information on Ionic Liquids: A Cheminformatics Study on Molecular Physicochemical Property Prediction
    Baran, Karol
    Kloskowski, Adam
    JOURNAL OF PHYSICAL CHEMISTRY B, 2023, 127 (49): : 10542 - 10555
  • [24] Defect Prediction With Semantics and Context Features of Codes Based on Graph Representation Learning
    Xu, Jiaxi
    Wang, Fei
    Ai, Jun
    IEEE TRANSACTIONS ON RELIABILITY, 2021, 70 (02) : 613 - 625
  • [25] Fuzzy Integral Based on Mutual Information for Software Defect Prediction
    Liu, Lu
    Li, Kewen
    Shao, Mingwen
    Liu, Wenying
    2015 INTERNATIONAL CONFERENCE ON CLOUD COMPUTING AND BIG DATA (CCBD), 2015, : 93 - 96
  • [26] A Fine-Grained Defect Prediction Method Based on Drift-Immune Graph Neural Networks
    Yang, Fengyu
    Zhong, Fa
    Wei, Xiaohui
    Zeng, Guangdong
    CMC-COMPUTERS MATERIALS & CONTINUA, 2025, 82 (02): : 3563 - 3590
  • [27] A cocrystal prediction method of graph neural networks based on molecular spatial information and global attention
    Kang, Yanlei
    Chen, Jiahui
    Hu, Xiurong
    Jiang, Yunliang
    Li, Zhong
    CRYSTENGCOMM, 2023, 25 (46) : 6405 - 6415
  • [28] Software Defect Prediction Using Artificial Neural Networks: A Systematic Literature Review
    Khan, Muhammad Adnan
    Elmitwally, Nouh Sabri
    Abbas, Sagheer
    Aftab, Shabib
    Ahmad, Munir
    Fayaz, Muhammad
    Khan, Faheem
    SCIENTIFIC PROGRAMMING, 2022, 2022
  • [29] Convolutional Neural Networks over Control Flow Graphs for Software Defect Prediction
    Anh Viet Phan
    Minh Le Nguyen
    Lam Thu Bui
    2017 IEEE 29TH INTERNATIONAL CONFERENCE ON TOOLS WITH ARTIFICIAL INTELLIGENCE (ICTAI 2017), 2017, : 45 - 52
  • [30] Software defect prediction employing BiLSTM and BERT-based semantic feature
    Md Nasir Uddin
    Bixin Li
    Zafar Ali
    Pavlos Kefalas
    Inayat Khan
    Islam Zada
    Soft Computing, 2022, 26 : 7877 - 7891