Abstract

[Context]Comments improve the readability of programs, so they are harmless to the software quality. However, may sometimes be added to compensate for the lack of readability in complicated programs. Some programmers want to add in-depth to their fragments which are hard to be understood by other developers. In the field of refactoring, well-written are known as artifacts related to code smells. While well-written themselves are harmless, they can play roles as deodorant beside bad source code.[Goal]The goal of this paper is to show a notable relationship between the fault-proneness and the commenting manner in methods declared in Java classes.[Method]We focused on two types of comments: comments and Documentation are ones followed by a method declaration, and inner are ones described inside a method body. We collected the following data from some major open source products: (1) Lines of Inner (LOI), (2) Lines of Documentation (LOD), and (3) Lines of Code (LOC), for each method appeared in their source files. [Method:Anslysis-1] Compared the ratios of faulty methods between sets of methods; Case 1: = 0 vs LOI > 0, and Case 2: = 0 vs LOD > 0. [Method:Analysis-2] Compared the ratios of faulty methods by some categories of lines of comments.[Results:Analysis-1]For all products, the methods having one or more inner are about two or three times likely to be faulty than the ones having no inner comments. Therefore, there is a trend which a method with inner is more faulty than a non-commented method. On the other hand, the presence or absence of documentation did not show no specific tendency.Since a larger program tends to be more faulty, we analyzed the effect of size (LOC) on the fault-proneness as well. We thus performed the logistic regression analysis with using all of LOC, LOI and LOD, in order to take their impacts apart. The result signified that the comparisons using LOI and/or LOD are not dominated by the size (LOC). That is to say, it is worthwhile to see associations of with fault-proneness.[Results:Analysis-2]The ratios of faulty methods monotonically increased from LOI = 0 to LOI = 2. The ratios in LOI = 3 and LOI ≥ 4 are not changed monotonically but both of them keep higher levels than LOI = 0.[Conclusions]Our results revealed a novel finding that even one or two inner can point to faulty methods. That is to say, if a programmer wants to add some onto their in a method, it may be a sign of poor quality and the method has a higher potential to be faulty.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.