Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
How good is your comment? A study of comments in Java programs
Haouari D., Sahraoui H., Langlais P.  ESEM 2011 (Proceedings of the 2011 International Symposium on Empirical Software Engineering and Measurement, Banff, Alberta, Canada, Sep 22-23, 2011)137-146.2011.Type:Proceedings
Date Reviewed: Jun 22 2012

To understand how developers comment, the Java code for three open-source projects was analyzed. Assuming a comment precedes the relevant program construct, an automatic analysis found that abstract methods, class declarations, interface declarations, and package declarations were almost always commented, while 61.1 percent of methods and 66.7 percent of constructors were commented. Interestingly, for DrJava, 54.1 percent of field declarations were commented, but only 3.5 percent of such program constructs were commented for SweetHome3D. The automatic analysis could have usefully quantified Javadoc usage, but did not.

Forty-nine programmers also manually categorized a subset of comments from the three open-source projects according to a taxonomy. Based on categorizations of 407 comments, it was found that 73 percent of comments preceded the relevant program construct, 71 percent of comments were explicative in nature, and 80 percent of explicative comments were explicit in nature, that is, written in terms of program keywords. Table 5 reveals that 29 percent of comments were judged to be poor. Of note, around half of all assignment and control flow comments were judged to be poor. The programmers also answered a questionnaire about their own commenting habits. In general, responses matched the findings already obtained. Figure 8, however, reveals that 44 percent of the programmers indicated that they use comments to express pre- and post- conditions. These important comment forms appear to have been overlooked when the categorizing taxonomy was developed.

Despite the criticisms above, this paper does provide useful insights into commenting habits and is recommended for software engineers and those researching software quality assurance.

Reviewer:  Andy Brooks Review #: CR140300 (1211-1149)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Documentation (D.2.7 ... )
 
 
Pre- And Post-Conditions (F.3.1 ... )
 
 
Software Quality Assurance (SQA) (D.2.9 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Documentation": Date
Illustrating computer documentation
Horton W., John Wiley & Sons, Inc., New York, NY, 1991. Type: Book (9780471538455)
Jun 1 1992
The art of technical documentation
Haramundanis K., Digital Press, Newton, MA, 1992. Type: Book (9781555580803)
Jun 1 1992
Integrated hypertext and program understanding tools
Brown P. IBM Systems Journal 30(3): 363-392, 1991. Type: Article
Nov 1 1992
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy