ComFormer: Code Comment Generation via Transformer and Fusion Method-based Hybrid Code Representation
Authors:
- 1 August 2021
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 30-41
Abstract
Developers often write low-quality code comments due to the lack of programming experience, which can reduce the efficiency of developers' program comprehension. Therefore, developers hope that code comment generation tools can be developed to illustrate the functionality and purpose of the code. Recently, researchers mainly model this problem as the neural machine translation problem and tend to use deep learning-based methods. In this study, we propose a novel method ComFormer based on Transformer and fusion method-based hybrid code presentation. Moreover, to alleviate OOV (out-of-vocabulary) problem and speed up model training, we further utilize the Byte-BPE algorithm to split identifiers and Sim_SBT method to perform AST Traversal. We compare ComFormer with seven state-of-the-art baselines from code comment generation and neural machine translation domains. Comparison results show the competitiveness of ComFormer in terms of three performance measures. Moreover, we perform a human study to verify that ComFormer can generate high-quality comments.Keywords
Funding Information
- National Natural Science Foundation of China
- Nanjing University of Aeronautics and Astronautics
This publication has 42 references indexed in Scilit:
- Using stereotypes in the automatic generation of natural language summaries for C++ methods2015
- Automatic Source Code Summarization of Context for Java MethodsIEEE Transactions on Software Engineering, 2015
- An Eye-Tracking Study of Java Programmers and Application to Source Code SummarizationIEEE Transactions on Software Engineering, 2015
- CloCom: Mining existing source code for automatic comment generation2015
- Improving automated source code summarization via an eye-tracking study of programmers2014
- Glove: Global Vectors for Word Representation2014
- Evaluating source code summarization techniques: Replication and expansion2013
- Generating Parameter Comments and Integrating with Method Summaries2011
- Towards automatically generating summary comments for Java methods2010
- API documentation from source code comments1999