arrow
Return

A Comparative Study on Method Comment and Inline Comment

delete2023-07-22
delete8
delete
OA
AI
黄袁 cover
黄袁 (Yuan Huang) *
H
Hanyang Guo
X
Xi Ding
J
Junhuai Shu
X
Xiangping Chen
X
Xiapu Luo
Z
Zibin Zheng
X
Xiaocong Zhou
DOI:10.1145/3582570delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Code comments are one of the important documents to help developers review and comprehend source code. In recent studies, researchers have proposed many deep learning models to generate the method header comments (i.e., method comment), which have achieved encouraging results. The comments in the method, which is called inline comment, are also important for program comprehension. Unfortunately, they have not received enough attention in automatic generation when comparing with the method comments. In this paper, we compare and analyze the similarities and differences between the method comments and the inline comments. By applying the existing models of generating method comments to the inline comment generation, we find that these existing models perform worse on the task of inline comment generation. We then further explore the possible reasons and obtain a number of new observations. For example, we find that there are a lot of templates (i.e., comments with the same or similar structures) in the method comment dataset, which makes the models perform better. Some terms were thought to be important (e.g., API calls) in the comment generation by previous study does not significantly affect the quality of the generated comments, which seems counter-intuitive. Our findings may give some implications for building the approaches of method comment or inline comment generation in the future.
Keywords:
Code comment
comparative study
comment generation
method comment
inline comment

Journal

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
Papers:
1.2K
Citations:
3.4K

Organization

H
hong kong polytechnic university
Scholars:
3.0W
Papers: 4.1W
Citations: 921
S
Sun Yat Sen University
Scholars:
9.9W
Papers: 7.2W
Citations: 95
Cited Papers

Cited Papers

err
IF0
err
err0
errOAAI
err
errShare
errSave
Classifying code comments in Java software systems
err2019-04-26
err34
errOAAI
errPascarella, Luca; Bruntink, Magiel; Bacchelli, Alberto
errShare
errSave
errShare
errSave
Poorer self-rated health in residential areas with limited healthcare supply
err2014-02-12
err0
PREAI
errSigríður Haraldsdóttir; Unnur A Valdimarsdóttir; Sigurður Guðmundsson
errShare
errSave
errShare
errSave
Establishment and characterization of a new triple-negative canine mammary cancer cell line
err2018-10-01
err0
PREAI
errHong Zhang; Shimin Pei; Bin Zhou; Huanan Wang; Hongchao Du; Di Zhang; Degui Lin
errShare
errSave
researcher View more