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

05/23/2020
by   Pooja Rani, et al.
0

Previous studies have characterized code comments in different programming languages. However, very few studies have focused on the analysis of the information embedded in code comments. None of them compared the developer's practices to write the comments to the standard guidelines and analyzed these characteristics in the Pharo Smalltalk environment. The class commenting practices have their origins in Smalltalk-80, going back 40 years. Smalltalk offers a brief template for entering a comment for newly-created classes. These templates have evolved over the years, particularly in the Pharo environment. This paper reports the first empirical study investigating commenting practices in Pharo Smalltalk. We quantitatively and qualitatively analyze class comments of the most recent version of Pharo, to investigate the information types of Pharo comments. Finally, we study the adherence of developer commenting practices to the class template over Pharo versions. The results show 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 ratio. Additionally, we found that 23 information types are typically embedded in class comments and only seven of them are present in the latest Pharo class comment template. However, the information types proposed by the standard 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 written and formatted in a non-uniform way. This suggests the need to standardize the commenting guidelines for formatting the text to ensure a consistent style, and to identify the information easily.

READ FULL TEXT

page 18

page 25

research
08/24/2021

Do Comments follow Commenting Conventions? A Case Study in Java and Python

Assessing code comment quality is known to be a difficult problem. A num...
research
02/18/2021

Speculative Analysis for Quality Assessment of Code Comments

Previous studies have shown that high-quality code comments assist devel...
research
08/17/2021

What Do Developers Discuss about Code Comments?

Code comments are important for program comprehension, development, and ...
research
01/18/2022

TYPIC: A Corpus of Template-Based Diagnostic Comments on Argumentation

Providing feedback on the argumentation of learner is essential for deve...
research
03/24/2021

Learning to Generate Code Comments from Class Hierarchies

Descriptive code comments are essential for supporting code comprehensio...
research
10/15/2021

Peer reviewers equally critique theory, method, and writing, with limited effect on manuscripts' content

Peer review aims to detect flaws and deficiencies in the design and inte...

Please sign up or login with your details

Forgot password? Click here to reset