Why not write all tests at once when doing TDD?

Posted by RichK on Programmers See other posts from Programmers or by RichK
Published on 2012-04-02T10:05:48Z Indexed on 2012/04/02 11:42 UTC
Read the original article Hit count: 177

Filed under:
|

The Red - Green - Refactor cycle for TDD is well established and accepted. We write one failing unit test and make it pass as simply as possible. What are the benefits to this approach over writing many failing unit tests for a class and make them all pass in one go.

The test suite still protects you against writing incorrect code or making mistakes in the refactoring stage, so what's the harm? Sometimes it's easier to write all the tests first as a form of 'brain dump' to quickly write down all the expected behavior in one go.

© Programmers or respective owner

Related posts about unit-testing

Related posts about TDD