Classifying code comments in Java software systems

Journal Article (2019)
Author(s)

L. Pascarella (TU Delft - Software Engineering)

Magiel Bruntink (Software Improvement Group)

A Bacchelli (Universitat Zurich)

Research Group
Software Engineering
Copyright
© 2019 L. Pascarella, Magiel Bruntink, A. Bacchelli
DOI related publication
https://doi.org/10.1007/s10664-019-09694-w
More Info
expand_more
Publication Year
2019
Language
English
Copyright
© 2019 L. Pascarella, Magiel Bruntink, A. Bacchelli
Research Group
Software Engineering
Issue number
3
Volume number
24
Pages (from-to)
1499-1537
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

Code comments are a key software component containing information about the underlying implementation. Several studies have shown that code comments enhance the readability of the code. Nevertheless, not all the comments have the same goal and target audience. In this paper, we investigate how 14 diverse Java open and closed source software projects use code comments, with the aim of understanding their purpose. Through our analysis, we produce a taxonomy of source code comments; subsequently, we investigate how often each category occur by manually classifying more than 40,000 lines of code comments from the aforementioned projects. In addition, we investigate how to automatically classify code comments at line level into our taxonomy using machine learning; initial results are promising and suggest that an accurate classification is within reach, even when training the machine learner on projects different than the target one.