Precise Learning of Source Code Contextual Semantics via Hierarchical Dependence Structure and Graph Attention Networks

被引:11
|
作者
Zhao, Zhehao [1 ]
Yang, Bo [2 ]
Li, Ge [1 ]
Liu, Huai [3 ]
Jin, Zhi [1 ]
机构
[1] Peking Univ, Key Lab High Confidence Software Technol, Beijing 100871, Peoples R China
[2] Beijing Forestry Univ, Sch Informat Sci & Technol, Beijing 100083, Peoples R China
[3] Swinburne Univ Technol, Dept Comp Technol, Hawthorn, Vic 3122, Australia
基金
澳大利亚研究理事会; 中国国家自然科学基金; 国家重点研发计划;
关键词
Graph neural network; Program analysis; Deep learning; Abstract syntax Tree; Control flow graph; NEURAL-NETWORK;
D O I
10.1016/j.jss.2021.111108
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Deep learning is being used extensively in a variety of software engineering tasks, e.g., program classification and defect prediction. Although the technique eliminates the required process of feature engineering, the construction of source code model significantly affects the performance on those tasks. Most recent works was mainly focused on complementing AST-based source code models by introducing contextual dependencies extracted from CFG. However, all of them pay little attention to the representation of basic blocks, which are the basis of contextual dependencies. In this paper, we integrated AST and CFG and proposed a novel source code model embedded with hierarchical dependencies. Based on that, we also designed a neural network that depends on the graph attention mechanism. Specifically, we introduced the syntactic structural of the basic block, i.e., its corresponding AST, in source code model to provide sufficient information and fill the gap. We have evaluated this model on three practical software engineering tasks and compared it with other state-of-the-art methods. The results show that our model can significantly improve the performance. For example, compared to the best performing baseline, our model reduces the scale of parameters by 50% and achieves 4% improvement on accuracy on program classification task. (c) 2021 Elsevier Inc. All rights reserved.
引用
收藏
页数:13
相关论文
共 47 条
  • [21] JLAN: medical code prediction via joint learning attention networks and denoising mechanism
    Li, Xingwang
    Zhang, Yijia
    ul Islam, Faiz
    Dong, Deshi
    Wei, Hao
    Lu, Mingyu
    BMC BIOINFORMATICS, 2021, 22 (01)
  • [22] JLAN: medical code prediction via joint learning attention networks and denoising mechanism
    Xingwang Li
    Yijia Zhang
    Faiz ul Islam
    Deshi Dong
    Hao Wei
    Mingyu Lu
    BMC Bioinformatics, 22
  • [23] Improving Cross-Language Code Clone Detection via Code Representation Learning and Graph Neural Networks
    Mehrotra, Nikita
    Sharma, Akash
    Jindal, Anmol
    Purandare, Rahul
    IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2023, 49 (11) : 4846 - 4868
  • [24] Source Code Authorship Attribution Using Hybrid Approach of Program Dependence Graph and Deep Learning Model
    Ullah, Farhan
    Wang, Junfeng
    Jabbar, Sohail
    Al-Turjman, Fadi
    Alazab, Mamoun
    IEEE ACCESS, 2019, 7 : 141987 - 141999
  • [25] Whole slide cervical cancer classification via graph attention networks and contrastive learning
    Fei, Manman
    Zhang, Xin
    Chen, Dongdong
    Song, Zhiyun
    Wang, Qian
    Zhang, Lichi
    NEUROCOMPUTING, 2025, 613
  • [26] Spatiotemporal reconstruction of unsteady bridge flow field via hierarchical graph neural networks with causal attention
    Cai, Chenzhi
    Xiao, Jun
    Zou, Yunfeng
    He, Xuhui
    PHYSICS OF FLUIDS, 2025, 37 (01)
  • [27] Detecting Runtime Exceptions by Deep Code Representation Learning with Attention-Based Graph Neural Networks
    Li, Rongfan
    Chen, Bihuan
    Zhang, Fengyi
    Sun, Chao
    Peng, Xin
    2022 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER 2022), 2022, : 373 - 384
  • [28] Detecting Runtime Exceptions by Deep Code Representation Learning with Attention-Based Graph Neural Networks
    School of Computer Science, Fudan University, Shanghai Key Laboratory of Data Science, China
    Proc. - IEEE Int. Conf. Softw. Anal., Evol. Reengineering, SANER, 2022, (373-384):
  • [29] CLG-Trans: Contrastive learning for code summarization via graph attention-based transformer
    Zeng, Jianwei
    He, Yutong
    Zhang, Tao
    Xu, Zhou
    Han, Qiang
    SCIENCE OF COMPUTER PROGRAMMING, 2023, 226
  • [30] Accurate protein function prediction via graph attention networks with predicted structure information
    Lai, Boqiao
    Xu, Jinbo
    BRIEFINGS IN BIOINFORMATICS, 2022, 23 (01)