We’ve covered a lot of ground, and we have gone into excruciating detail for a very simple test. All of the ground work is now done for us to speed up.
Let's look at the red, green, refactor cycle:
The steps of the TDD cycle are as follows:
Write a failing test: Write a short test that describes some functionality you want. Execute your test and watch it fail. If it doesn’t fail, then it's not a good test; go back and try again.
Make it pass: Make the test green. Do the simplest thing that will work. Feel free to make a mess; you can clean it up later.
Refactor your code: Stop, slow down, and resist the urge to move on to the next feature. Work hard to make your code—both production and test code—as clean as it can be.