Logo image
SeCNN: A semantic CNN parser for code comment generation
Journal article   Peer reviewed

SeCNN: A semantic CNN parser for code comment generation

Zheng Li, Yonghao Wu, Bin Peng, Xiang Chen, Zeyu Sun, Yong Liu and Deli Yu
The Journal of systems and software, Vol.181, p.111036
11/2021

Abstract

Code comment generation Convolutional Neural Network Long short-term memory network Program comprehension
A code comment generation system can summarize the semantic information of source code and generate a natural language description, which can help developers comprehend programs and reduce time cost spent during software maintenance. Most of state-of-the-art approaches use RNN (Recurrent Neural Network)-based encoder–decoder neural networks. However, this kind of method may not generate high-quality description when summarizing the information among several code blocks that are far from each other (i.e., the long-dependency problem). In this paper, we propose a novel Semantic CNN parser SeCNN for code comment generation. In particular, we use a CNN (Convolutional Neural Network) to alleviate the long-dependency problem and design several novel components, including source code-based CNN and AST-based CNN, to capture the semantic information of the source code. The evaluation is conducted on a widely-used large-scale dataset of 87,136 Java methods. Experimental results show that SeCNN achieves better performance (i.e., 44.69% in terms of BLEU and 26.88% in terms of METEOR) and has lower execution time cost when compared with five state-of-the-art baselines. •We propose a novel method SeCNN to generate code comments for Java methods.•We propose a novel AST traversal method, ISBT, to encode the structure information.•Experimental results show SeCNN is more effective than state-of-the-art baselines.•The code and dataset used in our paper are all available in the GitHub repository.

Metrics

1 Record Views

Details

Logo image