SeCNN: A semantic CNN parser for code comment generation

Zheng Li,Yonghao Wu,Bin Peng,Xiang Chen,Zeyu Sun,Yong Liu,Deli Yu
DOI: https://doi.org/10.1016/j.jss.2021.111036
IF: 3.5
2021-11-01
Journal of Systems and Software
Abstract:<p>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 <strong>Se</strong>mantic <strong>CNN</strong> 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 <span class="math"><math>BLEU</math></span> and 26.88% in terms of <span class="math"><math>METEOR</math></span>) and has lower execution time cost when compared with five state-of-the-art baselines.</p>
computer science, theory & methods, software engineering
What problem does this paper attempt to address?