arrow
Return

ClassSum: a deep learning model for class-level code summarization

delete2022-10-10
delete0
PRE
AI
M
Mingchen Li
H
Huiqun Yu *
G
Guisheng Fan *
Z
Ziyi Zhou
J
Jiawen Huang
DOI:10.1007/s00521-022-07877-zdelete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Code summaries are clear and concise natural language descriptions of program entities. Meaningful code summaries assist developers in better understanding. Code summarization refers to the task of generating a natural language summary from a code snippet. Most researches on code summarization focus on automatically generating summaries for methods or functions. However, in an object-oriented language such as Java, class is the basic programming unit rather than method. To fill this gap, in this paper, we investigate how to generate summaries for Java classes utilizing deep learning-based approaches. We propose a novel encoder–decoder model called ClassSum to generate functionality descriptions for Java classes and build a dataset containing 172,639 pairs from 3185 repositories hosted on Github. Since the code of class is much longer and more complicated, encoding a whole class via neural network is more challenging than encoding a method. On the other hand, the content within a class may be incomplete. To overcome this difficulty, we reduce the code of a class by only keeping its key elements, namely class signatures, method signatures and attribute names. To utilize both lexical and structural information of code, our model takes token sequence and abstract syntax tree of the reduced class content as inputs. ClassSum and five baselines (designed for method-level code summarization) are evaluated on our dataset. Experiment results show that summaries generated by ClassSum are more accurate and readable than those generated by baselines. Our dataset is available at https://github.com/classsum/ClassSum .
Keywords:
Program comprehension
Code summarization
Class documentation
Deep learning
Summarizing source code with hierarchical code representation
err2022-03-01
err14
PREAI
errZhou, Ziyi; Yu, Huiqun; Fan, Guisheng; Huang, Zijie; Yang, Xingguang
errShare
errSave
An Extractive-and-Abstractive Framework for Source Code Summarization
err2024-03-14
err5
errOAAI
errSun, Weisong; Fang, Chunrong; Chen, Yuchen; Zhang, Quanjun; Tao, Guanhong; You, Yudu; Han, Tingxu; Ge, Yifei; Hu, Yuling; Luo, Bin; Chen, Zhenyu
errShare
errSave
errShare
errSave
Autofolding for Source Code Summarization
err2017-12-01
err37
errOAAI
errFowkes, Jaroslav; Chanthirasegaran, Pankajan; Ranca, Razvan; Allamanis, Miltiadis; Lapata, Mirella; Sutton, Charles
errShare
errSave
Esale: Enhancing Code-Summary Alignment Learning for Source Code Summarization
err2024-08-01
err2
PREAI
errFang, Chunrong; Sun, Weisong; Chen, Yuchen; Chen, Xiao; Wei, Zhao; Zhang, Quanjun; You, Yudu; Luo, Bin; Liu, Yang; Chen, Zhenyu
errShare
errSave

Journal

Neural Computing and Applications cover
Neural Computing and Applications
IF:
4.5
Papers:
2.4K
Citations:
3.4W

Organization

No organization information available
Cited Papers

Cited Papers

BLEU
err2001-01-01
err0
errOAAI
errKishore Papineni; Salim Roukos; Todd Ward; Wei-Jing Zhu
errShare
errSave
errShare
errSave
Learning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation
err2014-01-01
err0
errOAAI
errKyunghyun Cho; Bart van Merrienboer; Caglar Gulcehre; Dzmitry Bahdanau; Fethi Bougares; Holger Schwenk; Yoshua Bengio
errShare
errSave
Source Code based On-demand Class Documentation Generation
err2020-09-01
err0
PREAI
errLiu,Mingwei; Peng,Xin; Meng,Xiujie; Xu,Huanjun; Xing,Shuangshuang; Wang,Xin; Liu,Yang; Lv,Gang
errShare
errSave
Long Short-Term Memory
err1997-11-01
err0
PREAI
errSepp Hochreiter; Jürgen Schmidhuber
errShare
errSave
On the Naturalness of Software
err2016-04-26
err164
PREAI
errHindle, Abram; Barr, Earl T.; Gabel, Mark; Su, Zhendong; Devanbu, Premkumar
errShare
errSave
researcher View more