O'Reilly logo

Effective Unit Testing: A guide for Java Developers by Lasse Koskela

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Part 2. Catalog

The goal of part 2 is to help us better identify and fix problems with our test code, and we’re taking a “catalog”-style approach to accomplishing that. This catalog is one of test smells—traits and attributes we often encounter in test code that create or aggravate problems in terms of maintainability, readability, and trustworthiness.

We are wallowing in this puddle of anti-patterns instead of walking through a list of good practices because I’ve found it more effective to teach programmers to identify problems with their tests and to rectify them. After all, if we only know what a good test looks like, we’re still blind to the many flaws our code may have.

My good friend Bas Vodde likes to say that if you remove all the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required