The Primary Benefit of TDD
With plain ol’ after-the-fact unit testing, the obvious, most significant benefit you gain is increased confidence that the code you write works as expected. With TDD, you gain that same benefit and more!
Systems degrade largely because we don’t strive often or hard enough to keep the code clean. We’re good at quickly adding code into our systems, but on the first pass, it’s more often not-so-great code than good code. We don’t spend a lot of effort cleaning up that initially bad code for many reasons. Pat chimes in with his list:
-
“We just have to move on to the next task. We don’t have time to gild the code.”
-
“I think the code reads just fine the way it is. I wrote it, I understand it. I can add some comments to the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access