In Test Driven Development, people use the phrase,
"Red, Green, Refactor". We say this because we decide what to write
based on the failing test we have. Once we get the test passing, we can go in
and refactor things without worrying that we are breaking this functionality.
Remember that tests are there to maintain your code as well as to give you the
opportunity to decide what interface you want for your code.
For more content, read Brendan
Enrick's Blog.