论文标题

班级评论告诉我们什么?对Pharo Smalltalk的评论演变和实践的调查

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

论文摘要

先前的研究表征了各种编程语言的代码评论,以支持更好的程序理解活动和维护任务。但是,很少有研究重点是理解开发人员实践来写评论。他们都没有将这种开发人员实践与标准评论指南进行比较,以研究开发人员遵守该指南的程度。本文报告了第一项经验研究,调查了Pharo Smalltalk的评论实践。首先,我们分析了七个Pharo版本的班级评论演变。然后,我们研究了类评论中嵌入的信息类型。最后,我们研究了开发人员评论实践对Pharo版本的官方班级评论模板的遵守。 这项研究的结果表明,在最初的三个PHARO版本中,类评论的班级评论迅速增加,而在随后的版本中,开发人员对新类和旧类添加了评论,从而保持了与评论比率相似的代码。此外,我们发现类评论中的信息类型是模板的三倍。但是,模板建议的信息类型往往比其他类型的信息更频繁地存在。此外,我们发现,很大一部分评论遵循模板的写作样式,但它们是以不均匀的方式编写和格式的,这表明需要标准化格式的评论指南,以便为文本格式化,并为不同信息类型提供标题,以确保不同信息类型,以确保一致的样式并轻松识别信息。鉴于高质量代码评论的重要性,我们为开发人员和研究人员提高了对评论质量评估工具的支持。

Previous studies have characterized code comments in various programming languages to support better program comprehension activities and 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 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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源