Hacker News new | past | comments | ask | show | jobs | submit login

Automated tests are a checklist for when you refactor code: "The code is supposed to do A, B, and C. Does it still do those things?" If you practice TDD, the tests are just-in-time checklists for your implementation work.

The problem with relying on tests written after the implementation is that the checklist might be incomplete. If your checklist is incomplete, then you can't rely on it. Of course, even a highly disciplined practitioner of TDD cannot produce a test suite that is guaranteed to be complete and correct, but there is an enormous difference between a checklist that is adequate 50 % of the time and one that is adequate 95 % of the time.

Look for ways to avoid simply "going through the motions". Checklists (including TDD) are about avoiding making mistakes, not merely about noticing when you do make mistakes.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact