What Do Developers Discuss about Code Comments?

Rani, Pooja; Birrer, Mathias; Panichella, Sebastiano; Ghafari, Mohammad; Nierstrasz, Oscar (2021). What Do Developers Discuss about Code Comments? In: 2021 IEEE 21st International Working Conference on Source Code Analysis and Manipulation (SCAM). Luxembourg. Sept. 27 2021 to Sept. 28 2021. 10.1109/SCAM52516.2021.00027

[img]
Preview
Text
Rani21e.pdf - Accepted Version
Available under License Creative Commons: Attribution (CC-BY).

Download (853kB) | Preview
[img] Text
What_Do_Developers_Discuss_about_Code_Comments.pdf - Published Version
Restricted to registered users only
Available under License Publisher holds Copyright.

Download (1MB) | Request a copy

Code comments are important for program comprehension, development, and maintenance tasks. Given the varying standards for code comments, and their unstructured or semi-structured nature, developers get easily confused (especially novice developers) about which convention(s) to follow, or what tools to use while writing code documentation. Thus, they post related questions on external online sources to seek better commenting practices. In this paper, we analyze code comment discussions on online sources such as Stack Overflow (SO) and Quora to shed some light on the questions developers ask about commenting practices. We apply Latent Dirichlet Allocation (LDA) to identify emerging topics concerning code comments. Then we manually analyze a statistically significant sample set of posts to derive a taxonomy that provides an overview of the developer questions about commenting practices. Our results highlight that on SO nearly 40 of the questions mention how to write or process comments in documentation tools and environments, and nearly 20 of the questions are about potential limitations and possibilities of documentation tools to add automatically and consistently more information in comments. On the other hand, on Quora, developer questions focus more on background information (35 of the questions) or asking opinions (16 of the questions) about code comments. We found that (i) not all aspects of comments are covered in coding style guidelines, e.g., how to add a specific type of information, (ii) developers need support in learning the syntax and format conventions to add various types of information in comments, and (iii) developers are interested in various automated strategies for comments such as detection of bad comments, or verify comment style automatically, but lack tool support to do that.

Item Type:

Conference or Workshop Item (Paper)

Division/Institute:

08 Faculty of Science > Institute of Computer Science (INF)
08 Faculty of Science > Institute of Computer Science (INF) > Software Composition Group (SCG) [discontinued]

UniBE Contributor:

Pooja Rani, Pooja Rani, Ghafari, Mohammad, Nierstrasz, Oscar

Subjects:

000 Computer science, knowledge & systems

ISBN:

978-1-6654-4897-0

Language:

English

Submitter:

Oscar Nierstrasz

Date Deposited:

24 Feb 2022 12:06

Last Modified:

02 Mar 2023 23:35

Publisher DOI:

10.1109/SCAM52516.2021.00027

ArXiv ID:

2108.07648v1

Uncontrolled Keywords:

comments snf-asa3 jb22 scg21 scg-pub

BORIS DOI:

10.48350/165153

URI:

https://boris.unibe.ch/id/eprint/165153

Actions (login required)

Edit item Edit item
Provide Feedback