Are you tired of writing tests which have a lot of boilerplate code? If so, get started with Spock Framework >>

Clean Tests

Writing Clean Tests – Java 8 to the Rescue

In the previous part of this tutorial we solved some common problems found from “clean” unit tests by using nested configuration. I was very happy with the final test class, but after a while I realized that something was bothering me. The only

Writing Clean Tests – Small Is Beautiful

We have learned that “clean” unit tests might not be as clean as we think. We have done our best to make our unit tests as clean as possible. Our tests are formatted properly, use domain-specific language, and avoid excessive mocking.

Writing Clean Tests – Trouble in Paradise

If our code has obvious faults, we are very motivated to improve it. However, at some point we decide that our code is “good enough” and move on. Typically this happens when we think that the benefits of improving our existing code are

Writing Clean Tests – Divide and Conquer

A good unit test should fail for only one reason. This means that a proper unit test tests only one logical concept. If we want to write clean tests, we have to identify those logical concepts, and write only one test case per logical concept. This