September 28, 2016
September 16, 2016
September 12, 2016
September 12, 2016
August 29, 2016
Sometimes, tests imitate code, and not in a good way. Here’s our tested code: public String encode(String word) { String result = word + word.length(); return result; } And here’s our test: @Test public void howItsDone() { Encoder enc =… Continue Reading…
August 13, 2016
You’re testing the right thing, and the test passes, and everything is cool. Or is it? Check out this test: @Test public void encodeString_sizeAtEnd() { Encoder enc = new Encoder(); String result = enc.encode(“hello”); assertEquals(“hello5”, result); } This test looks… Continue Reading…
October 3, 2023
August 5, 2016
Anti-patterns are patterns with negative consequences. In this series I’m going to tackle those patterns, explain what they signify in terms of risks, and what to do instead. Let’s look at a pattern common to people who start out on… Continue Reading…
June 1, 2016
Last time we’ve started talking about how to approach TDD in real, complex systems. While plain vanilla TDD assumes nothing about the world around our component, in real life, there are constraints we need to relate to. Where we stopped,… Continue Reading…
June 18, 2016
TDD comes from the world of unit testing. It’s optimized for small pieces of code; small increments of functionality. BDD takes the test-first approach, adds functional and user semantics and tries to follow the same formula for the whole software.… Continue Reading…