Blog Archives

So Let’s Test The POJOs

So the code coverage is mediocre and there are loads of getters and setters and equals methods out there sitting untested. Let’s impress our lords and masters by running some tests against them. Assert that when you set the value,

Posted in Java, tdd

How Mocks Ruin Everything

Despite being an ardent advocate of TDD, mocking and Mockito (which is totally awesome), I’m going to argue against mocks. It had to happen. I’ve found really clear situations where mocks have made my work harder, and it’s got to stop!

Posted in Java, tdd

Mockito Argument Matching in Java 8

When using mocks, we often want to check the inputs to a function that was called on the mock. It’s probably a subject for another post whether you should rely on doing this, or whether you should make more code that

Posted in Java, tdd

Automated Testing is a Broad Church

I’ve had the pleasure to be working on an automated testing framework recently. This seems to solve a problem that we’ve been having with Cucumber. I will write a more detailed piece on this in the near future, but here’s

Posted in Java, tdd

So you want to write BDD tests?

Before you can write BDD tests, you probably need to know what they are. Short answer – BDD tests try to black-box test something according to its behaviour. One of the most common languages is Gherkin. In principle, Gherkin is

Posted in bdd, Java, tdd

Going Round and Round redux

This article is another visit to the subject raised in this previous post. The aim of this discussion is to convert to Java and present a new solution. The question revolves around the difficulty in finding a good loop construct

Tagged with: ,
Posted in Java

(Three) is the Magic Number

I’ve been pondering magic numbers. We all know that code such as this: is to be discouraged, what’s two in this case? what’s 8? what if they change? So you’re supposed to take these numbers out of the code and

Posted in .NET, Java