Augmenting Java Method Comments Generation with Context Information Based on Neural Networks

Yu Zhou,Xin Yan,Wenhua Yang,Taolue Chen,Zhiqiu Huang
DOI: https://doi.org/10.1016/j.jss.2019.07.087
IF: 3.5
2019-01-01
Journal of Systems and Software
Abstract:Code comments are crucial to program comprehension. In this paper, we propose a novel approach ContextCC to automatically generate concise comments for Java methods based on neural networks, leveraging techniques of program analysis and natural language processing. Firstly, ContextCC employs program analysis techniques, especially abstract syntax tree parsing, to extract context information including methods and their dependency. Secondly, it filters code and comments out of the context information to build up a high-quality data set based on a set of pre-defined templates and rules. Finally, ContextCC trains a code comment generation model based on recurrent neural networks. Experiments are conducted on Java projects crawled from GitHub. We show empirically that the performance of ContextCC is superior to state-of-the-art baseline methods. (C) 2019 Elsevier Inc. All rights reserved.
What problem does this paper attempt to address?