Home » Tag Archives: Testing (page 18)

Tag Archives: Testing

Test Data Builders and Object Mother: another look

Constructing objects in tests is usually a painstaking work and usually it produces a lot of repeatable and hard to read code. There are two common solutions for working with complex test data: Object Mother and Test Data Builder. Both has advantages and disadvantages, but (smartly) combined can bring new quality to your tests. Note: There are already many articles ...

Read More »

Continuous Delivery: Unit Tests

In the previous article we explored static analysis as one of the first steps in Continuous Delivery. Our journey will continue with unit tests. Unit Tests Unit tests are probably the most important part of Continuous Delivery. While unit tests cannot substitute integration and functional tests, they are very easy to write and should be very fast to execute. As ...

Read More »


I’ve been thinking about what makes TDD fail, and there are obviously few reasons that were discussed to death (Get it? Dead? TDD? Ok, let’s move on). There’s a pattern I see when working with beginners. I’m talking about TDD beginners, because these people may have years of experience on them.  They follow the red-green steps religiously, and do minimal ...

Read More »

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 blog post describes how we can identify the logical concepts found from our tests, ...

Read More »

Testing effectively

Recently, there was a heaty debate regarding TDD which started by DHH when he claimed that TDD is dead. This ongoing debate managed to capture the attention of developers world, including us. Some mini debates have happened in our office regarding the right practices to do testing. In this article, I will present my own view.   How many kinds ...

Read More »

Writing Clean Tests – New Considered Harmful


It is pretty hard to figure out a good definition for clean code because everyone of us has our own definition for the word clean. However, there is one definition which seems to be universal: Clean code is easy to read. This might come as a surprise to some of you, but I think that this definition applies to test ...

Read More »

Spice up your test code with custom assertions

Inspired by the @tkaczanowski talk during GeeCON conference I decided to have a closer look at custom assertions with AssertJ library. In my ‘Dice’ game I created a ‘Chance’ that is any combination of dice with the score calculated as a sum of all dice. This is relatively simple object:             class Chance implements Scorable ...

Read More »