Tuesday, April 15, 2008

Test-first doesn't mean every test must be written before you start coding

It's worth noting that test-first doesn't mean that all the tests have to be written before any code is written. In fact, in some cases, it's actually impossible to write the test before the implementation is at least partly scoped out (e.g., when it's necessary to mock objects or modules external to what you're testing). A lot of test cases end up coming up during the development process. Just like elsewhere in agile development, the secret is in tight loops. Write the test as soon as possible, but no sooner than necessary.

No comments: