Unit Tests Anti-patterns: TDD without refactoring
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 their TDD journey: They forget to refactor. When they do, 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…
TDD In Real Life – Part 1
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. TDD helps us build a class or a module. But Read more…
New Version of “Everyday Unit Testing”
That’s right! It’s been a while, but lots of content going into the new version, which you can download right now. What’s added? Two new chapters: Testing strategy – how to think about testing (and unit testing) a feature. TDD – My take on TDD. It’s still got long to Read more…
Legacy Code to Testable Code #13: The Testable Object
Other awesome posts in the series: If the code we want to test is highly-decoupled from its dependencies, we probably don’t need to do anything to it. But when we have a medium-big ball of mud things change. There are parts we want to ignore or control through mocking, and Read more…
Testing is not a phase!
It used to be. Somewhere, squeezed between the end of development and release. But then things changed, because they had to. We’re testing product ideas, way before there’s one line of code. We’re testing the code as it’s being written, because we want to make sure it does what we Read more…
Error handling: Checking for exceptions
When we talked about understanding what we’re actually testing in error handling, we talked about the ability to understand the behavior of our code-under-test . Just to recall, here are the three types of error implementation, and what we can check: No error handling – Any exception is handled somewhere Read more…
Unit Testing Error Handling and Exceptions
One of the things that unit tests are best for is checking error conditions. While we want wider coverage of full happy flows, error conditions are sometimes hard to simulate in a big system, and unit tests excel at minimal setup to make sure our code handles the problem correctly. We have Read more…