In test driven development we are supposed to write the unit tests before writing the actual code. After that we will write just enough code to pass the test cases. That code is probably not optimal, so when our test cases pass we can start refactoring our code. After we finish refactoring the test cases should still pass.
In a diagram that would look like: