What do class comments tell us? An investigation of comment evolution and practices in Pharo Smalltalk

Rani, Pooja; Panichella, Sebastiano; Leuenberger, Manuel; Ghafari, Mohammad; Nierstrasz, Oscar (2021). What do class comments tell us? An investigation of comment evolution and practices in Pharo Smalltalk. Empirical software engineering, 26(112), pp. 1-49. Springer 10.1007/s10664-021-09981-5

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

Download (5MB) | Preview

Previous studies have characterized code comments in various programming languages, showing how high quality of code comments is crucial to support program comprehension activities, and to improve the effectiveness of maintenance tasks. However, very few studies have focused on understanding developer practices to write comments. None of them has compared such developer practices to the standard comment guidelines to study the extent to which developers follow the guidelines. This paper reports the first empirical study investigating commenting practices in Pharo Smalltalk. First, we analyze class comment evolution over seven Pharo versions. Then, we quantitatively and qualitatively investigate the information types embedded in class comments. Finally, we study the adherence of developer commenting practices to the official class comment template over Pharo versions. The results of this study show that there is a rapid increase in class comments in the initial three Pharo versions, while in subsequent versions developers added comments to both new and old classes, thus maintaining a similar code to comment ratio. We furthermore found three times as many information types in class comments as those suggested by the template. However, the information types suggested by the template tend to be present more often than other types of information. Additionally, we find that a substantial proportion of comments follow the writing style of the template in writing these information types, but they are written and formatted in a non-uniform way. This suggests the need to standardize the commenting guidelines for formatting the text, and to provide headers for the different information types to ensure a consistent style and to identify the information easily. Given the importance of high-quality code comments, we draw numerous implications for developers and researchers to improve the support for comment quality assessment tools.

Item Type:

Journal Article (Original Article)

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, Leuenberger, Manuel, Ghafari, Mohammad, Nierstrasz, Oscar

Subjects:

000 Computer science, knowledge & systems

ISSN:

1573-7616

Publisher:

Springer

Language:

English

Submitter:

Oscar Nierstrasz

Date Deposited:

22 Feb 2022 15:11

Last Modified:

02 Mar 2023 23:35

Publisher DOI:

10.1007/s10664-021-09981-5

Uncontrolled Keywords:

comments scg-pub scg21 jb21 snf-asa3 pharo

BORIS DOI:

10.48350/165150

URI:

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

Actions (login required)

Edit item Edit item
Provide Feedback