Blog Archives

Stream of Null

I quite like refactoring code from Java 7 (and lower) syntax into the Java 8 streams. I find the streams to be more expressive of the intent of the code and the boilerplate of the long-winded version seems evaporate, leaving

Posted in Java

Anyone fancy a curry?

For no reason other than it’s interesting, here’s a take on Currying in Java 8. The idea of currying is to convert a function that takes n parameters into one which can receive them one by one, or indeed all

Posted in Uncategorized

Stop fixing it already…

Over in Fix it twice? I discussed why a second attempt at fixing an issue, to use hindsight of an actual fix as a way to improve the software, was a great idea. In this piece, I’d like to discuss the aim

Posted in Uncategorized

Fix it twice?

One of the many catchphrases I use with my team is Fix it twice. This refers more to the Red – Green – Refactor cycle. For clarity, that’s usually used during TDD where you go Red – a failing test. Then you do whatever

Posted in Uncategorized

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