TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

TDD and the Zero-Defects Myth

6 pointsby sklivvz19715 months ago

1 comment

hitchstory5 months ago
&gt;If you’ve ever heard someone claim that Test-Driven Development leads to zero-defects code<p>I havent. It&#x27;s a <i>lot</i> more reliable, still not 100% reliable.<p>&gt;If you can define the inputs, predict the outputs, and cover edge cases, TDD is like a superpower. But the real world is rarely that tidy.<p><i>shrug</i> it ought to be that tidy if you specify your features before building them.<p>For writing code to test a sin function (a bit of a contrived example, but let&#x27;s run with it) - well, that would be an excellent candidate for property test driven development because there are straightforward invariants you can define.<p>When edge cases crop up for other styles of code, well, talk about them with your PM and write test cases for them too.<p>If the spec is something like a UI which is visual and specified imprecisely with a sketch or something, snapshot test driven development more appropriate but that&#x27;s still just a variant of TDD.