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.


翻译:先前的研究对各种编程语言的代码评论进行了定性,以支持更好地规划理解活动和维护任务。然而,很少有研究侧重于理解开发者编写评论的做法,没有一项研究将这类开发者做法与标准评论准则进行比较,以研究开发者遵循准则的程度。本文报告了第一次经验研究,调查法罗·斯马约克(Pharo Smallaltalk)中的评论做法。首先,我们分析七个法罗版本中的类评论演变情况。然后,我们调查各类评论中所含的信息类型。最后,我们研究开发者对法罗版本的官方级评论模板的评论做法的遵守情况。本研究的结果表明,最初三个法罗版本中的类评论迅速增加,而随后版本的开发者则在新旧版本中都增加了评论,从而保持了类似评论比率。我们发现,类评论中的三种信息类型比模板中建议的信息类型要多三倍。我们发现,模板中的信息类型往往比其他类型的信息更经常出现。我们发现,大量的评论都遵循这些信息类型中的格式格式的写法格式格式,但是它们以书面和格式方式将质量评论迅速地增加,但以书面和格式的方式向不同格式提供格式的版本。

0
下载
关闭预览

相关内容

《计算机信息》杂志发表高质量的论文,扩大了运筹学和计算的范围,寻求有关理论、方法、实验、系统和应用方面的原创研究论文、新颖的调查和教程论文,以及描述新的和有用的软件工具的论文。官网链接:https://pubsonline.informs.org/journal/ijoc
【2020新书】Web应用安全,331页pdf
专知会员服务
23+阅读 · 2020年10月24日
【Manning新书】现代Java实战,592页pdf
专知会员服务
98+阅读 · 2020年5月22日
开源书:PyTorch深度学习起步
专知会员服务
49+阅读 · 2019年10月11日
强化学习最新教程,17页pdf
专知会员服务
168+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
90+阅读 · 2019年10月10日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
计算机 | EMNLP 2019等国际会议信息6条
Call4Papers
18+阅读 · 2019年4月26日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
CCF B类期刊IPM专刊截稿信息1条
Call4Papers
3+阅读 · 2018年10月11日
计算机类 | 期刊专刊截稿信息9条
Call4Papers
4+阅读 · 2018年1月26日
Coursera上Python课程(公开课)汇总
数据挖掘入门与实战
6+阅读 · 2017年12月27日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
VIP会员
相关VIP内容
【2020新书】Web应用安全,331页pdf
专知会员服务
23+阅读 · 2020年10月24日
【Manning新书】现代Java实战,592页pdf
专知会员服务
98+阅读 · 2020年5月22日
开源书:PyTorch深度学习起步
专知会员服务
49+阅读 · 2019年10月11日
强化学习最新教程,17页pdf
专知会员服务
168+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
90+阅读 · 2019年10月10日
相关资讯
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
计算机 | EMNLP 2019等国际会议信息6条
Call4Papers
18+阅读 · 2019年4月26日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
CCF B类期刊IPM专刊截稿信息1条
Call4Papers
3+阅读 · 2018年10月11日
计算机类 | 期刊专刊截稿信息9条
Call4Papers
4+阅读 · 2018年1月26日
Coursera上Python课程(公开课)汇总
数据挖掘入门与实战
6+阅读 · 2017年12月27日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
Top
微信扫码咨询专知VIP会员