DeepCommenter: A deep code comment generation tool with hybrid lexical and syntactical information
As the scale of software projects increases, the code comments are more and more important for program comprehension. Unfortunately, many code comments are missing, mismatched or outdated due to tight development schedule or other reasons. Automatic code comment generation is of great help for devel...
Saved in:
Main Authors: | , , , , , |
---|---|
Format: | text |
Language: | English |
Published: |
Institutional Knowledge at Singapore Management University
2020
|
Subjects: | |
Online Access: | https://ink.library.smu.edu.sg/sis_research/5631 https://ink.library.smu.edu.sg/context/sis_research/article/6634/viewcontent/DeepCommenter_pv.pdf |
Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
Institution: | Singapore Management University |
Language: | English |
id |
sg-smu-ink.sis_research-6634 |
---|---|
record_format |
dspace |
spelling |
sg-smu-ink.sis_research-66342021-05-10T07:55:30Z DeepCommenter: A deep code comment generation tool with hybrid lexical and syntactical information LI, Boao YAN, Meng XIA, Xin HU, Xing LI, Ge LO, David As the scale of software projects increases, the code comments are more and more important for program comprehension. Unfortunately, many code comments are missing, mismatched or outdated due to tight development schedule or other reasons. Automatic code comment generation is of great help for developers to comprehend source code and reduce their workload. Thus, we propose a code comment generation tool (DeepCommenter) to generate descriptive comments for Java methods. DeepCommenter formulates the comment generation task as a machine translation problem and exploits a deep neural network that combines the lexical and structural information of Java methods. We implement DeepCommenter in the form of an Integrated Development Environment (i.e., Intellij IDEA) plug-in. Such plug-in is built upon a Client/Server architecture. The client formats the code selected by the user, sends request to the server and inserts the comment generated by the server above the selected code. The server listens for client’s request, analyzes the requested code using the pre-trained model and sends back the generated comment to the client. The pre-trained model learns both the lexical and syntactical information from source code tokens and Abstract Syntax Trees (AST) respectively and combines these two types of information together to generate comments. To evaluate DeepCommenter, we conduct experiments on a large corpus built from a large number of open source Java projects on GitHub. The experimental results on different metrics show that DeepCommenter outperforms the state-of-the-art approaches by a substantial margin. Demo URL: https://youtu.be/acdH5X-eBw4; Plug-in download: https://git.io/JegwQ 2020-11-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/5631 info:doi/10.1145/3368089.3417926 https://ink.library.smu.edu.sg/context/sis_research/article/6634/viewcontent/DeepCommenter_pv.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Comment generation program comprehension deep learning Software Engineering |
institution |
Singapore Management University |
building |
SMU Libraries |
continent |
Asia |
country |
Singapore Singapore |
content_provider |
SMU Libraries |
collection |
InK@SMU |
language |
English |
topic |
Comment generation program comprehension deep learning Software Engineering |
spellingShingle |
Comment generation program comprehension deep learning Software Engineering LI, Boao YAN, Meng XIA, Xin HU, Xing LI, Ge LO, David DeepCommenter: A deep code comment generation tool with hybrid lexical and syntactical information |
description |
As the scale of software projects increases, the code comments are more and more important for program comprehension. Unfortunately, many code comments are missing, mismatched or outdated due to tight development schedule or other reasons. Automatic code comment generation is of great help for developers to comprehend source code and reduce their workload. Thus, we propose a code comment generation tool (DeepCommenter) to generate descriptive comments for Java methods. DeepCommenter formulates the comment generation task as a machine translation problem and exploits a deep neural network that combines the lexical and structural information of Java methods. We implement DeepCommenter in the form of an Integrated Development Environment (i.e., Intellij IDEA) plug-in. Such plug-in is built upon a Client/Server architecture. The client formats the code selected by the user, sends request to the server and inserts the comment generated by the server above the selected code. The server listens for client’s request, analyzes the requested code using the pre-trained model and sends back the generated comment to the client. The pre-trained model learns both the lexical and syntactical information from source code tokens and Abstract Syntax Trees (AST) respectively and combines these two types of information together to generate comments. To evaluate DeepCommenter, we conduct experiments on a large corpus built from a large number of open source Java projects on GitHub. The experimental results on different metrics show that DeepCommenter outperforms the state-of-the-art approaches by a substantial margin. Demo URL: https://youtu.be/acdH5X-eBw4; Plug-in download: https://git.io/JegwQ |
format |
text |
author |
LI, Boao YAN, Meng XIA, Xin HU, Xing LI, Ge LO, David |
author_facet |
LI, Boao YAN, Meng XIA, Xin HU, Xing LI, Ge LO, David |
author_sort |
LI, Boao |
title |
DeepCommenter: A deep code comment generation tool with hybrid lexical and syntactical information |
title_short |
DeepCommenter: A deep code comment generation tool with hybrid lexical and syntactical information |
title_full |
DeepCommenter: A deep code comment generation tool with hybrid lexical and syntactical information |
title_fullStr |
DeepCommenter: A deep code comment generation tool with hybrid lexical and syntactical information |
title_full_unstemmed |
DeepCommenter: A deep code comment generation tool with hybrid lexical and syntactical information |
title_sort |
deepcommenter: a deep code comment generation tool with hybrid lexical and syntactical information |
publisher |
Institutional Knowledge at Singapore Management University |
publishDate |
2020 |
url |
https://ink.library.smu.edu.sg/sis_research/5631 https://ink.library.smu.edu.sg/context/sis_research/article/6634/viewcontent/DeepCommenter_pv.pdf |
_version_ |
1770575536100212736 |