Decide what to do, figure out how to do it and then do it well. These are the three essential steps we perform over and over again in TDD. Each step is different and requires us to focus on different things.
Separating out these steps helps us focus on each one at the right time, and with the right context. When we mix these steps up we tend to get confused or overwhelmed. Separating these steps supports the way we naturally think and it supports us in doing the right things at the right time.
Each step is important.
We may think that we haven’t made a lot of progress getting the red bar but indeed we have; we’ve defined a testable behavior, named it, created an interface to it and have identified what has to happen before we are done building it.
Turning the red bar green means that we’ve arrived at an implementation that works; this means that we’ve written an algorithm that satisfies all the tests so far and we are well on our way to finishing that functionality.
Refactoring for quality means that we are making our code robust and maintainable so it will be releasable as a product; this means we are handling alternate paths and exceptions, making the code easier to read and understand, and adding the right abstractions to make it easier to extend in the future.
By separating these three steps out we assure that each is given proper attention. For more details on each step read the following posts.