This paper focuses on comments described in Java programs, and conducts an empirical analysis about relationships between comments and fault-proneness in the programs. The types of comments analyzed in this paper are comments described inside a method body (inner comments), and comments followed by a method declaration (documentation comments). Although both of them play important roles in the program comprehension, they seem to be described in different purposes, The inner comments are often added to present tips about code fragments, while the documentation comments usually work as a programmer's manual. In the field of code refactoring, well-written inner comments are said to be related to "code smell" since they may cover a lack of readability in a complicated code fragment. This paper analyzes the associations of comments with the code quality from the aspect of fault-proneness, with using four popular open source products. The empirical results show that a method having inner comments tends to be 1.8 - 3.0 times likely to be faulty. The key contribution of this work is to reveal the usefulness of inner comments to point at faulty methods.
[1]
Hirohisa Aman.
An Empirical Analysis of the Impact of Comment Statements on Fault-Proneness of Small-Size Module
,
2012,
2012 19th Asia-Pacific Software Engineering Conference.
[2]
Scott N. Woodfield,et al.
The effect of modularization and comments on program comprehension
,
1981,
ICSE '81.
[3]
Hirohisa Aman.
An Empirical Analysis on Fault-Proneness of Well-Commented Modules
,
2012,
2012 Fourth International Workshop on Empirical Software Engineering in Practice.
[4]
Nicolas Anquetil,et al.
A study of the documentation essential to software maintenance
,
2005,
SIGDOC '05.
[5]
Brian W. Kernighan,et al.
The Practice of Programming
,
1999
.
[6]
Ted Tenny,et al.
Program Readability: Procedures Versus Comments
,
1988,
IEEE Trans. Software Eng..
[7]
Elmar Jürgens,et al.
Quality analysis of source code comments
,
2013,
2013 21st International Conference on Program Comprehension (ICPC).