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 条
  • [41] Spatiotemporal Prediction of Nitrogen Dioxide Based on Graph Neural Networks
    Iskandaryan, Ditsuhi
    Ramos, Francisco
    Trilles, Sergio
    ADVANCES AND NEW TRENDS IN ENVIRONMENTAL INFORMATICS, 2023, : 111 - 128
  • [42] A General Tensor Prediction Framework Based on Graph Neural Networks
    Zhong, Yang
    Yu, Hongyu
    Gong, Xingao
    Xiang, Hongjun
    JOURNAL OF PHYSICAL CHEMISTRY LETTERS, 2023, 14 (28): : 6339 - 6348
  • [43] Introducing Semantic-Based Receptive Field into Semantic Segmentation via Graph Neural Networks
    Jia, Daixi
    Gao, Hang
    Su, Xingzhe
    Wu, Fengge
    Zhao, Junsuo
    NEURAL INFORMATION PROCESSING, ICONIP 2023, PT VI, 2024, 14452 : 434 - 451
  • [44] On the Prediction Instability of Graph Neural Networks
    Klabunde, Max
    Lemmerich, Florian
    MACHINE LEARNING AND KNOWLEDGE DISCOVERY IN DATABASES, ECML PKDD 2022, PT III, 2023, 13715 : 187 - 202
  • [45] Invertible Neural Networks for Graph Prediction
    Xu C.
    Cheng X.
    Xie Y.
    IEEE Journal on Selected Areas in Information Theory, 2022, 3 (03): : 454 - 467
  • [46] Motif Prediction with Graph Neural Networks
    Besta, Maciej
    Grob, Raphael
    Miglioli, Cesare
    Bernold, Nicola
    Kwasniewski, Grzegorz
    Gjini, Gabriel
    Kanakagiri, Raghavendra
    Ashkboos, Saleh
    Gianinazzi, Lukas
    Dryden, Nikoli
    Hoefler, Torsten
    PROCEEDINGS OF THE 28TH ACM SIGKDD CONFERENCE ON KNOWLEDGE DISCOVERY AND DATA MINING, KDD 2022, 2022, : 35 - 45
  • [47] Structural and Semantic Proximity in Information Networks
    Franzoni, Valentina
    Milani, Alfredo
    COMPUTATIONAL SCIENCE AND ITS APPLICATIONS - ICCSA 2017, PT I, 2017, 10404 : 651 - 666
  • [48] Information Obfuscation of Graph Neural Networks
    Liao, Peiyuan
    Zhao, Han
    Xu, Keyulu
    Jaakkola, Tommi
    Gordon, Geoffrey
    Jegelka, Stefanie
    Salakhutdinov, Ruslan
    INTERNATIONAL CONFERENCE ON MACHINE LEARNING, VOL 139, 2021, 139
  • [49] Enriching Demand Prediction with Product Relationship Information using Graph Neural Networks
    Yilmaz, Yaren
    Oguducu, Gunduz
    PROCEEDINGS OF THE 2021 IEEE/ACM INTERNATIONAL CONFERENCE ON ADVANCES IN SOCIAL NETWORKS ANALYSIS AND MINING, ASONAM 2021, 2021, : 561 - 568
  • [50] Relation Prediction via Graph Neural Network in Heterogeneous Information Networks with Missing Type Information
    Zhang, Han
    Hao, Yu
    Cao, Xin
    Fang, Yixiang
    Shin, Won-Yong
    Wang, Wei
    PROCEEDINGS OF THE 30TH ACM INTERNATIONAL CONFERENCE ON INFORMATION & KNOWLEDGE MANAGEMENT, CIKM 2021, 2021, : 2517 - 2526