[PDF][PDF] Generating automatically class comments in Pharo

L Hess, O Nierstrasz, P Rani - 2021 - scg.unibe.ch
2021scg.unibe.ch
Code comments play a vital role in the development, comprehension and maintenance of
code-bases as shown by many works before. Developers use code comments to explain
various types of information such as rationale, examples, future tasks, usage of a class or
method and many more. In Pharo, a Smalltalk based environment, code comments comprise
up to 15% of the code. They are the main form of code documentation in Pharo. However,
developers find writing code comments a tedious and boring, or even hard task. Therefore …
Abstract
Code comments play a vital role in the development, comprehension and maintenance of code-bases as shown by many works before. Developers use code comments to explain various types of information such as rationale, examples, future tasks, usage of a class or method and many more. In Pharo, a Smalltalk based environment, code comments comprise up to 15% of the code. They are the main form of code documentation in Pharo. However, developers find writing code comments a tedious and boring, or even hard task. Therefore, code often lacks comments and makes the code hard to understand and follow.
Previous works have proposed to automatically generate comments to reduce the commenting efforts and to support developers. Automatically generating comments helps developers spend less time on writing code comments and writing uniform code comments. One of the more popular approaches to generate comments automatically is based on stereotypes. A stereotype is a generalized idea or set of characteristics believed to represent an object or person. In software development class or method stereotypes are often used to classify the functionality of the methods or classes in broad strokes. We choose a similar stereotype-based approach for Pharo code comments. Our work adapts heuristics of similar works, to allow us to generate method and class stereotypes for classes in Pharo. With this in mind we created a tool that lets us generate class comments automatically based on these class stereotypes. We illustrate our approach with the help of a running example in Pharo.
scg.unibe.ch
以上显示的是最相近的搜索结果。 查看全部搜索结果