Not logged in.

Contribution Details

Type Journal Article
Scope Discipline-based scholarship
Title Analyzing the co-evolution of comments and source code
Organization Unit
Authors
  • Beat Fluri
  • Michael Würsch
  • Emanuel Giger
  • H C Gall
Item Subtype Original Work
Refereed Yes
Status Published in final form
Language
  • English
Journal Title Software Quality Journal
Publisher Springer
Geographical Reach international
ISSN 0963-9314
Volume 17
Number 4
Page Range 367 - 394
Date 2009
Abstract Text Source code comments are a valuable instrument to preserve design decisions and to communicate the intent of the code to programmers and maintainers. Nevertheless, commenting source code and keeping them up-to-date is often neglected for reasons of time or programmer’s obliviousness. In this paper, we investigate the question whether developers comment their code and to which extent they add comments or adapt them when they evolve the code. We present an approach to associate comments with source code entities to track their co-evolution over multiple versions. A set of heuristics are used to decide whether a comment is associated to its preceding or its succeeding source code entity. We analyzed the co-evolution of code and comments in eight different open source and closed source software systems. We found with statistical significance that (1) the relative amount of comments and source code grows at about the same rate; (2) the type of a source code entity, such as a method declaration or an if-statement, has a significant influence on whether or not it gets commented; (3) in six out of the eight systems, code and comments co-evolve in 90 percent of the cases; and (4) surprisingly, API changes and comments do not co-evolve but they are re-documented in a later revision. As a result, our approach enables a quantitative assessment of the commenting process in a software system. We can, therefore, leverage the results to provide feedback during development to increase the awareness when to add comments or when to adapt comments because of source code changes.
Digital Object Identifier 10.1007/s11219-009-9075-x
Other Identification Number merlin-id:142
PDF File Download from ZORA
Export BibTeX
EP3 XML (ZORA)
Keywords Software evolution analysis - Software repositories - Source code changes - Comment changes - Comment quality - Software maintenance