An exploration of how comments are used for marking related code fragments

A software developer performing a change task to a system very often has to examine a concern that is scattered across the source code of the system. Although many mechanisms attempt to alleviate the problem of dealing with scattered code, many software developers are still using more ad-hoc approaches to mark related code. In this paper, we explore how developers use comments to mark related code. We found that developers use two basic kinds of conventions to mark related code in comments: by explicitly stating relationships in the comment and by using similar comments in related code elements. These conventions have several major issues. However, we observe that using comments to mark related code fragments offers several benefits. We hope that our observations can give insights into building better tool support for scattered code fragments.

[1]  William G. Griswold,et al.  Exploiting the map metaphor in a tool for software evolution , 2001, Proceedings of the 23rd International Conference on Software Engineering. ICSE 2001.

[2]  Gregor Kiczales,et al.  Aspect-oriented programming , 1996, CSUR.

[3]  William G. Griswold,et al.  Coping with Crosscutting Software Changes Using Information Transparency , 2001, Reflection.

[4]  Stanley M. Sutton,et al.  N degrees of separation: multi-dimensional separation of concerns , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[5]  Cristina V. Lopes,et al.  Aspect-oriented programming , 1999, ECOOP Workshops.

[6]  Martin P. Robillard,et al.  Concern graphs: finding and describing concerns using structural program dependencies , 2002, Proceedings of the 24th International Conference on Software Engineering. ICSE 2002.