10 Test code quality
This chapter covers
- Principles and best practices of good and maintainable test code
- Avoiding test smells that hinder the comprehension and evolution of test code
You have probably noticed that once test infected, the number of JUnit tests a software development team writes and maintains can become significant. In practice, test code bases grow quickly. Moreover, we have observed that Lehman’s law of evolution, “Code tends to rot, unless one actively works against it” (1980), also applies to test code. A 2018 literature review by Garousi and Küçük shows that our body of knowledge about things that can go wrong with test code is already comprehensive.
As with production code, we must put extra effort into writing high-quality ...
Get Effective Software Testing now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.