Do Code and Comments Co-Evolve? On the Relation between Source Code and Comment Changes
Beat Fluri, Michael Würsch, Harald C. Gall · Proceedings - Working Conference on Reverse Engineering · 2007
Comments are valuable especially for program understanding and maintenance, but do developers comment their code? To which extent do they add comments or adapt them when they evolve the code? We examine the question whether source code and associated comments are really changed together along the evolutionary history of a software system. In this paper, we describe an approach to map code and comments to observe their co-evolution over multiple versions. We investigated three open source systems (i.e., ArgoUML, Azureus, and JDT core) and describe how comments and code co-evolved over time. Some of our findings show that: 1) newly added code - despite its growth rate - barely gets commented; 2) class and method declarations are commented most frequently but far less, for example, method calls; and 3) that 97% of comment changes are done in the same revision as the associated source code change.
Cited by 228 works. doi:10.1109/wcre.2007.21 Open-access PDF
Authors
References
- Populating a Release History Database from version control and bug tracking systems
- Recovering traceability links between code and documentation
- Change detection in hierarchically structured information
- Change Distilling:Tree Differencing for Fine-Grained Source Code Change Extraction
- Object-Oriented Reengineering Patterns
- Recovering documentation-to-source-code traceability links using latent semantic indexing
- UMLDiff
- Change detection in hierarchically structured information
- A differencing algorithm for object-oriented programs
- Program readability: procedures versus comments