Automatic source code summarization with graph attention networks

被引:17
|
作者
Zhou, Yu [1 ,3 ]
Shen, Juanjuan [1 ]
Zhang, Xiaoqing [1 ]
Yang, Wenhua [1 ,3 ]
Han, Tingting [2 ]
Chen, Taolue [2 ,3 ]
机构
[1] Nanjing Univ Aeronaut & Astronaut, Coll Comp Sci & Technol, Nanjing, Peoples R China
[2] Birkbeck Univ London, Dept Comp Sci, London, England
[3] Nanjing Univ, State Key Lab Novel Software Technol, Nanjing, Peoples R China
基金
中国国家自然科学基金; 英国工程与自然科学研究理事会;
关键词
Source code summarization; Recurrent neural network; Graph neural network; PROGRAM; COMPREHENSION; CONTEXT;
D O I
10.1016/j.jss.2022.111257
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Source code summarization aims to generate concise descriptions for code snippets in a natural language, thereby facilitates program comprehension and software maintenance. In this paper, we propose a novel approach-GSCS-to automatically generate summaries for Java methods, which leverages both semantic and structural information of the code snippets. To this end, GSCS utilizes Graph Attention Networks to process the tokenized abstract syntax tree of the program, which employ a multi-head attention mechanism to learn node features in diverse representation sub-spaces, and aggregate features by assigning different weights to its neighbor nodes. GSCS further harnesses an additional RNN-based sequence model to obtain the semantic features and optimizes the structure by combining its output with a transformed embedding layer. We evaluate our approach on two widely adopted Java datasets; the experiment results confirm that GSCS outperforms the state-of-the-art baselines. (c) 2022 Elsevier Inc. All rights reserved.
引用
收藏
页数:12
相关论文
共 50 条
  • [41] Entity Based Source Code Summarization (EBSCS)
    Babu, Chitti K.
    Kavitha, C.
    SankarRam, N.
    [J]. 2016 3RD INTERNATIONAL CONFERENCE ON ADVANCED COMPUTING AND COMMUNICATION SYSTEMS (ICACCS), 2016,
  • [42] A Neural Framework for Retrieval and Summarization of Source Code
    Chen, Qingying
    Zhou, Minghui
    [J]. PROCEEDINGS OF THE 2018 33RD IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMTED SOFTWARE ENGINEERING (ASE' 18), 2018, : 826 - 831
  • [43] An data augmentation method for source code summarization
    Song, Zixuan
    Zeng, Hui
    Shang, Xiuwei
    Li, Guanxi
    Li, Hui
    Guo, Shikai
    [J]. NEUROCOMPUTING, 2023, 549
  • [44] Supporting software documentation with source code summarization
    Al-Msie'deen, Ra'Fat
    Blasi, Anas H.
    [J]. INTERNATIONAL JOURNAL OF ADVANCED AND APPLIED SCIENCES, 2019, 6 (01): : 59 - 67
  • [45] Revisiting file context for source code summarization
    Su, Chia-Yi
    Bansal, Aakash
    McMillan, Collin
    [J]. AUTOMATED SOFTWARE ENGINEERING, 2024, 31 (02)
  • [46] Automatic text summarization with neural networks
    Kaikhah, K
    [J]. 2004 2ND INTERNATIONAL IEEE CONFERENCE INTELLIGENT SYSTEMS, VOLS 1 AND 2, PROCEEDINGS, 2004, : 40 - 44
  • [47] Code2graph: Automatic Generation of Static Call Graphs for Python']Python Source Code
    Gharibi, Gharib
    Tripathi, Rashmi
    Lee, Yugyung
    [J]. PROCEEDINGS OF THE 2018 33RD IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMTED SOFTWARE ENGINEERING (ASE' 18), 2018, : 880 - 883
  • [48] Unsupervised Classifying of Software Source Code Using Graph Neural Networks
    Vytovtov, Petr
    Chuvilin, Kirill
    [J]. PROCEEDINGS OF THE 24TH CONFERENCE OF OPEN INNOVATIONS ASSOCIATION (FRUCT), 2019, : 518 - 524
  • [49] Sentence Graph Attention for Content-Aware Summarization
    Siragusa, Giovanni
    Robaldo, Livio
    [J]. APPLIED SCIENCES-BASEL, 2022, 12 (20):
  • [50] Adversarial training and ensemble learning for automatic code summarization
    Ziyi Zhou
    Huiqun Yu
    Guisheng Fan
    [J]. Neural Computing and Applications, 2021, 33 : 12571 - 12589