TDDTesting

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,… Continue Reading…

legacy codeUnit testsWriting Tests

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… Continue Reading…

TDDTestingUnit testsWriting Tests

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… Continue Reading…

TDDTest strategy

InfoQ Interview on Test First Approaches

My interview on InfoQ about “Test-first approaches with TDD and BDD” is live. Go check it out. And come to the Agile Practitioners conference to experience these things yourselves!

legacy codeRefactoring

Legacy Code To Testable Code #12: Instance Constructors

Other awesome posts in the series: So we talked about static constructors and how to go around them. How about instance constructors? Are they innocent or guilty of the same crimes as their static brothers? I think Java got the… Continue Reading…

legacy codeRefactoringUnit tests

Legacy Code to Testable Code #11: MOAR Static Constructors

The other posts in the series: Where we last left off, we discussed how to dismantle the static constructor (or initializer) booby traps. And I promised you an example. I’ll do that in C#, but the operations apply to any… Continue Reading…

legacy codeRefactoring

Legacy Code to Testable Code #10: Getting Rid of Static Constructors

Here is the rest of the gang: This time we’re going to tackle the most problematic issue in testing object-oriented languages. Obviously because constructors only exist in those, but also, because even power tools have problems handling them. But we’ll start… Continue Reading…

Test strategyTesting

Testing Strategy Analysis – An Example

Each stage of implementation is hard in its own way. When we start out with a new effort or process, we think of it as: Sure, it will be hard in the beginning, but it’s going to become easier as… Continue Reading…

TDD

TDD: Speed and Flow

Kevlin Henney asked once: Why do cars have brakes? Imagine if cars didn’t have brakes, how fast would you go? You’ll be driving really slow to not hit anything. But by giving the capability to slow down, brakes actually give… Continue Reading…

TDDUncategorized

TDD: It’s Not That Simple

TDD is pretty simple right? Obey the red-green-refactor step-by-step and you’re on your way to glorious, non-legacy code. It’s really easy to explain. The rules are easy to follow. Why then so few people actually do it, and when they… Continue Reading…