|
|
|
|
|
by tsimionescu
1407 days ago
|
|
Yes, if you were right about the requirements, even if they weren't well specified. But if it turns out you implemented the wrong thing (either because the requirements simply changed for external reasons, or because you missed some fundamental aspect), then you wouldn't have had to debug, refractor or maintain that initial code, and the initial tests will probably be completely useless even if you end up salvaging some of the initial implementation. |
|
With TDD, the inner programming loop is:
1. form a belief about requirements
2. write a test to express that belief
3. write code to make that test pass
Without TDD, the loop is:
1. form a belief about requirements
2. write code to express that belief
3. futz around with manual testing, REPLs, and after-the-fact testing until you're sufficiently happy that the code actually does express that belief
And in my experience, the former loop is faster at producing working code.