Deep code comment generation

Xing Hu, Ge Li, Xin Xia, David Lo, Zhi Jin

Research output: Chapter in Book/Report/Conference proceedingConference PaperResearchpeer-review

125 Citations (Scopus)

Abstract

During software maintenance, code comments help developers comprehend programs and reduce additional time spent on reading and navigating source code. Unfortunately, these comments are often 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 generated comments aim to help developers understand the functionality of Java methods. DeepCom applies Natural Language Processing (NLP) techniques to learn from a large code corpus and generates comments from learned features. We use a deep neural network that analyzes structural information of Java methods for better comments generation. We conduct experiments on a large-scale Java corpus built from 9,714 open source projects from GitHub. We evaluate the experimental results on a machine translation metric. Experimental results demonstrate that our method DeepCom outperforms the state-of-the-art by a substantial margin.

Original languageEnglish
Title of host publicationProceedings - 2018 ACM/IEEE 26th International Conference on Program Comprehension, ICPC 2018
Subtitle of host publicationGothenburg, Sweden 27-28 May 2018
EditorsChanchal K. Roy, Janet Siegmund
Place of PublicationNew York NY USA
PublisherIEEE, Institute of Electrical and Electronics Engineers
Pages200-210
Number of pages11
ISBN (Electronic)9781450357142
DOIs
Publication statusPublished - 2018
EventInternational Conference on Program Comprehension 2018 - Gothenburg, Sweden
Duration: 27 May 201828 May 2018
Conference number: 26th
https://conf.researchr.org/home/icpc-2018

Conference

ConferenceInternational Conference on Program Comprehension 2018
Abbreviated titleICPC 2018
CountrySweden
CityGothenburg
Period27/05/1828/05/18
Internet address

Keywords

  • comment generation
  • deep learning
  • program comprehension

Cite this