Code Summarization with Abstract Syntax Tree

被引:8
|
作者
Chen, Qiuyuan [1 ]
Hu, Han [2 ]
Liu, Zhaoyi [3 ]
机构
[1] Zhejiang Univ, Coll Comp Sci & Technol, Hangzhou, Peoples R China
[2] Tsinghua Univ, Sch Software, Beijing, Peoples R China
[3] Peking Univ, Sch Shenzhen Grad, Shenzhen 518055, Peoples R China
关键词
Code summarization; Code clone; Code representation;
D O I
10.1007/978-3-030-36802-9_69
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Code summarization, which provides a high-level description of the function implemented by code, plays a vital role in software maintenance and code retrieval. Traditional approaches focus on retrieving similar code snippets to generate summaries, and recently researchers pay increasing attention to leverage deep learning approaches, especially the encoder-decoder framework. Approaches based on encoder-decoder suffer from two drawbacks: (a) Lack of summarization in functionality level; (b) Code snippets are always too long (more than ten words), regular encoders perform poorly. In this paper, we propose a novel code representation with the help of Abstract Syntax Trees, which could describe the functionality of code snippets and shortens the length of inputs. Based on our proposed code representation, we develop Generative Task, which aims to generate summary sentences of code snippets. Experiments on large-scale real-world industrial Java projects indicate that our approaches are effective and outperform the state-of-the-art approaches in code summarization.
引用
收藏
页码:652 / 660
页数:9
相关论文
共 50 条
  • [21] Deep learning with class-level abstract syntax tree and code histories for detecting code modification requirements
    Buyuk, O. O.
    Nizam, A.
    JOURNAL OF SYSTEMS AND SOFTWARE, 2023, 206
  • [22] A Source Code Plagiarism Detecting Method Using Sequence Alignment with Abstract Syntax Tree Elements
    Kikuchi, Hiroshi
    Goto, Takaaki
    Wakatsuki, Mitsuo
    Nishino, Tetsuro
    INTERNATIONAL JOURNAL OF SOFTWARE INNOVATION, 2015, 3 (03) : 41 - 56
  • [23] Detecting Code Clones with Graph Neural Network and Flow-Augmented Abstract Syntax Tree
    Wang, Wenhan
    Li, Ge
    Ma, Bo
    Xia, Xin
    Jin, Zhi
    PROCEEDINGS OF THE 2020 IEEE 27TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION, AND REENGINEERING (SANER '20), 2020, : 261 - 271
  • [24] A Fast Abstract Syntax Tree Interpreter for R
    Kalibera, Tomas
    Maj, Petr
    Morandat, Floreal
    Vitek, Jan
    ACM SIGPLAN NOTICES, 2014, 49 (07) : 89 - 102
  • [25] Fine-Grained Code Clone Detection with Block-Based Splitting of Abstract Syntax Tree
    Hu, Tiancheng
    Xu, Zijing
    Fang, Yilin
    Wu, Yueming
    Yuan, Bin
    Zou, Deqing
    Jin, Hai
    PROCEEDINGS OF THE 32ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2023, 2023, : 89 - 100
  • [26] Rule-based techniques using abstract syntax tree for code optimization and secure programming in java
    Hung-Cuong, Nguyen
    Quyet-Thang, Huynh
    Ba-Vuong, Tru
    Lecture Notes of the Institute for Computer Sciences, Social-Informatics and Telecommunications Engineering, LNICST, 2014, 128 : 168 - 177
  • [27] A Code Plagiarism Detection System Based on Abstract Syntax Tree and a High Level Fuzzy Petri Net
    Shen, Victor R. L.
    Putri, Farica P.
    INTERNATIONAL CONFERENCE ON MATERIALS, MANUFACTURING AND MECHANICAL ENGINEERING (MMME 2016), 2016, : 133 - 139
  • [28] Abstract Syntax Networks for Code Generation and Semantic Parsing
    Rabinovich, Maxim
    Stern, Mitchell
    Klein, Dan
    PROCEEDINGS OF THE 55TH ANNUAL MEETING OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS (ACL 2017), VOL 1, 2017, : 1139 - 1149
  • [29] Modeling Hierarchical Syntax Structure with Triplet Position for Source Code Summarization
    Guo, Juncai
    Liu, Jin
    Wan, Yao
    Li, Li
    Zhou, Pingyi
    PROCEEDINGS OF THE 60TH ANNUAL MEETING OF THE ASSOCIATION FOR COMPUTATIONAL LINGUISTICS (ACL 2022), VOL 1: (LONG PAPERS), 2022, : 486 - 500
  • [30] Modeling Hierarchical Syntax Structure with Triplet Position for Source Code Summarization
    Guo, Juncai
    Liu, Jin
    Wan, Yao
    Li, Li
    Zhou, Pingyi
    Proceedings of the Annual Meeting of the Association for Computational Linguistics, 2022, 1 : 486 - 500