During software maintenance, code comments help developerscomprehend programs and reduce additional time spent on readingand navigating source code. Unfortunately, these comments areoften mismatched, missing or outdated in the software projects.Developers have to infer the functionality from the source code.This paper proposes a new approach named DeepCom to automatically generate code comments for Java methods. The generatedcomments aim to help developers understand the functionalityof Java methods. DeepCom applies Natural Language Processing(NLP) techniques to learn from a large code corpus and generatescomments from learned features. We use a deep neural networkthat analyzes structural information of Java methods for bettercomments generation. We conduct experiments on a large-scaleJava corpus built from 9,714 open source projects from GitHub. Weevaluate the experimental results on a machine translation metric. Experimental results demonstrate that our method DeepComoutperforms the state-of-the-art by a substantial margin.
- comment generation,
- deep learning,
- program comprehension
Available at: http://works.bepress.com/david_lo/234/