Unit Testing Anti-Pattern: Misleading Tests

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 ok. I bet that without looking at the implementation, you Read more…

TDD In Real Life – Part 2

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, we talked about rethinking the order of work, based on Read more…