Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
The quality of JUnit tests: an empirical study report
Ma’ayan D.  SQUADE 2018 (Proceedings of the 1st International Workshop on Software Qualities and Their Dependencies, Gothenburg, Sweden, May 28, 2018)33-36.2018.Type:Proceedings
Date Reviewed: Jul 25 2019

To what extent are good practices followed when writing JUnit tests? To answer this question, an automated static analysis of 112 Java repositories from the Qualitas corpus was conducted. Of the 112 projects, 70 were found to have used JUnit as their testing framework. Over 55000 JUnit tests were analyzed.

Some 61 percent of testing methods were found to contain more than a single assertion, violating the single checkpoint principle. Almost 31 percent of tests were found to be nonlinear, being made up of loops or if statements. Some 77 percent of assertTrue and assertFalse assertions were found not to have any customized error message. Little use was made of Hamcrest, a third-party assertion library.

The investigator correctly draws attention to the main validity threats. First, the Qualitas corpus dates from 2013. Many changes could have occurred since then, such as the adoption and use of third-party assertion libraries. Second, many systems were found to be using their own assertion methods, which were not part of the analysis. A number of customized assertion methods should have been manually analyzed to provide the reader with insights into their importance. Also, some indication should have been given to the alternative testing frameworks (such as TestNG) used in the other 42 projects.

The conclusion drawn is sound: good practices were often not followed. This paper is recommended to those who work in software quality assurance.

Reviewer:  Andy Brooks Review #: CR146631 (1910-0370)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
Testing And Debugging (D.2.5 )
 
 
Metrics (D.2.8 )
 
Would you recommend this review?
yes
no
Other reviews under "Testing And Debugging": Date
Software defect removal
Dunn R., McGraw-Hill, Inc., New York, NY, 1984. Type: Book (9789780070183131)
Mar 1 1985
On the optimum checkpoint selection problem
Toueg S., Babaoglu O. SIAM Journal on Computing 13(3): 630-649, 1984. Type: Article
Mar 1 1985
Software testing management
Royer T., Prentice-Hall, Inc., Upper Saddle River, NJ, 1993. Type: Book (9780135329870)
Mar 1 1994
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