Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1109/ESEM.2011.22guideproceedingsArticle/Chapter ViewAbstractPublication PagesConference Proceedingsacm-pubtype
Article

How Good is Your Comment? A Study of Comments in Java Programs

Published: 22 September 2011 Publication History

Abstract

Comments are very useful to developers during maintenance tasks and are useful as well to help structuring a code at development time. They convey useful information about the system functionalities as well as the state of mind of a developer. Comments in code have been the focus of several studies, but none of them was targeted at analyzing commenting habits precisely. In this paper, we present an empirical study which analyzes existing comments in different open source Java projects. We study comments from both a quantitative and a qualitative point of view. We propose a taxonomy of comments that we used for conducting our analysis.

Cited By

View all
  • (2024)What Makes a Good TODO Comment?ACM Transactions on Software Engineering and Methodology10.1145/366481133:6(1-30)Online publication date: 28-Jun-2024
  • (2024)Do Code Summarization Models Process Too Much Information? Function Signature May Be All That Is NeededACM Transactions on Software Engineering and Methodology10.1145/365215633:6(1-35)Online publication date: 27-Jun-2024
  • (2024)Towards Summarizing Code Snippets Using Pre-Trained TransformersProceedings of the 32nd IEEE/ACM International Conference on Program Comprehension10.1145/3643916.3644400(1-12)Online publication date: 15-Apr-2024
  • Show More Cited By

Recommendations

Reviews

Andrew Brooks

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. Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

cover image Guide Proceedings
ESEM '11: Proceedings of the 2011 International Symposium on Empirical Software Engineering and Measurement
September 2011
473 pages
ISBN:9780769546049

Publisher

IEEE Computer Society

United States

Publication History

Published: 22 September 2011

Author Tags

  1. Comment distribution
  2. comment content
  3. comment frequency
  4. comment relevance

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 05 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)What Makes a Good TODO Comment?ACM Transactions on Software Engineering and Methodology10.1145/366481133:6(1-30)Online publication date: 28-Jun-2024
  • (2024)Do Code Summarization Models Process Too Much Information? Function Signature May Be All That Is NeededACM Transactions on Software Engineering and Methodology10.1145/365215633:6(1-35)Online publication date: 27-Jun-2024
  • (2024)Towards Summarizing Code Snippets Using Pre-Trained TransformersProceedings of the 32nd IEEE/ACM International Conference on Program Comprehension10.1145/3643916.3644400(1-12)Online publication date: 15-Apr-2024
  • (2023)Suboptimal Comments in Java Projects: From Independent Comment Changes to Commenting PracticesACM Transactions on Software Engineering and Methodology10.1145/354694932:2(1-33)Online publication date: 29-Mar-2023
  • (2023)On the Significance of Category Prediction for Code-Comment SynchronizationACM Transactions on Software Engineering and Methodology10.1145/353411732:2(1-41)Online publication date: 29-Mar-2023
  • (2023)A decade of code comment quality assessmentJournal of Systems and Software10.1016/j.jss.2022.111515195:COnline publication date: 1-Jan-2023
  • (2023)Monolingual, multilingual and cross-lingual code comment classificationEngineering Applications of Artificial Intelligence10.1016/j.engappai.2023.106485124:COnline publication date: 1-Sep-2023
  • (2022)Clone-based code method usage pattern miningProceedings of the 30th IEEE/ACM International Conference on Program Comprehension10.1145/3524610.3527880(543-547)Online publication date: 16-May-2022
  • (2022)A Review on Source Code DocumentationACM Transactions on Intelligent Systems and Technology10.1145/351931213:5(1-44)Online publication date: 21-Jun-2022
  • (2021)Speculative analysis for quality assessment of code commentsProceedings of the 43rd International Conference on Software Engineering: Companion Proceedings10.1109/ICSE-Companion52605.2021.00132(299-303)Online publication date: 25-May-2021
  • Show More Cited By

View Options

View options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media