arrow
返回

A Comparative Study on Method Comment and Inline Comment

delete2023-07-22
delete8
delete
OA
AI
黄袁 封面图
黄袁 (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
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

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.
Keyword:
Code comment
comparative study
comment generation
method comment
inline comment

期刊

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
论文数:
1.2K
被引数:
3.4K

机构

H
hong kong polytechnic university
学者数:
3.0W
论文数: 4.1W
被引数: 921
S
Sun Yat Sen University
学者数:
9.9W
论文数: 7.2W
被引数: 95
引用论文

引用论文

err
IF0
err
err0
errOAAI
err
err分享
err收藏
err分享
err收藏
err分享
err收藏
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
err分享
err收藏
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
err分享
err收藏
学者 查看更多内容