HACKER Q&A
📣 mdgrech23

What's Your Stance on TDD?


What's Your Stance on TDD?


  👤 __s Accepted Answer ✓
Read Chapter 20 of Code Complete

Testing is one part of QA. It's good to have it from the start. But in the end you need multiple dimensions of QA as each find non overlapping sets of issues

Most importantly: experiment. Find what works for your team on your product. Maybe TDD works. Maybe it works to brainstorm tests during the review stage

Code Complete does push that the earlier you detect an issue the cheaper it is to fix. TDD certainly makes a noble effort to detect issues early

& to quote Chapter 22: All in all, I think test-first programming is one of the most beneficial software practices to emerge during the past decade and is a good general approach. But it isn't a testing panacea, because it's subject to the general limitations of developer testing, which are described next.


👤 tpmx
Done in light moderation it's useful, especially in fields that really lean themselves towards this (stuff like e.g. compilers). We used to just call that the "test suite" back in the 90s before TDD was a thing.

It's a common mistake for TDD-addicted newbies to drag down their own productivity by spending half of their time writing mostly pointless test cases, even when they're just writing exploratory code, or code that doesn't really lend it self to be self-tested.