Have you ever heard of "fake it 'til you make it?" How about, "Assert First" or "Test Triangulation?" These are just some of the test writing techniques that we'll cover in this episode—and cover with lots and lots of code.
Then we'll face the ultimate existential question of tests: "What's more important, the tests or the production code?" Indeed, we'll pose it a problem of two disk drives: one containing the tests and the other containing the production code. One of them has crashed; which do you hope it is?
How much of your refactoring effort should be spent refactoring the tests? Any? And if you do refactor the tests, what is the goal of that refactoring? What does a good clean test look like?
Kent Beck often says, "First make it work. Then make it right. Then make it fast and small."
Ron Jeffries' rules of Simple Design tell us that the code should:
- Pass all the tests
- Have no duplication
- Express everything the author wants expressed
- Have a minimum of classes and methods
What do these rules have to do with tests? Should they be followed when writing tests? Or, is there a different set of rules for tests? The answer may surprise you.
Finally, we'll talk about the term Test First, and find out what it really means.
So get ready to read lots of code, think lots of thoughts, and face the ultimate truth of test-driven development.