EUVIMEDEUVIMED entdecken
Open Access · CC BY-NC 4.0

A Comparative Study on Method Comment and Inline Comment

Yuan Huang, Hanyang Guo, Xi Ding, Junhuai Shu, Xiangping Chen, Xiapu Luo, Zibin Zheng, Xiaocong Zhou

ACM Transactions on Software Engineering and Methodology · 30.09.2023 · 32 (5) · 1-26

DOI: 10.1145/3582570 ↗

Kurz gefasst

Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 22.07.2023. Verfasst von Yuan Huang und 7 weiteren Autor:innen. Die Arbeit wurde bisher 27-mal zitiert (Crossref) und nennt 63 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY-NC 4.0). Gefördert von: Guangdong Key Area R&D Program, National Natural Science Foundation of China, Hong Kong RGC Project.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

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.

Förderung

  • Guangdong Key Area R&D Program
  • National Natural Science Foundation of China
  • Hong Kong RGC Project
  • Hong Kong ITF Project
  • Research and Development Program of Shenzhen

Zitieren

APA

Huang, Y., Guo, H., Ding, X., Shu, J., Chen, X., Luo, X., Zheng, Z., & Zhou, X. (2023). A Comparative Study on Method Comment and Inline Comment. ACM Transactions on Software Engineering and Methodology, 32(5), 1-26. https://doi.org/10.1145/3582570

Vancouver

Huang Y, Guo H, Ding X, Shu J, Chen X, Luo X, et al. A Comparative Study on Method Comment and Inline Comment. ACM Transactions on Software Engineering and Methodology. 2023;32(5):1-26. doi:10.1145/3582570

BibTeX
@article{Huang2023,
  author = {Huang, Yuan and Guo, Hanyang and Ding, Xi and Shu, Junhuai and Chen, Xiangping and Luo, Xiapu and Zheng, Zibin and Zhou, Xiaocong},
  title = {A Comparative Study on Method Comment and Inline Comment},
  journal = {ACM Transactions on Software Engineering and Methodology},
  year = {2023},
  volume = {32},
  number = {5},
  pages = {1--26},
  doi = {10.1145/3582570}
}
Kostenlos starten →