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.

Test-Driven Development Is Fundamentally Wrong

43 pointsby psalminenover 5 years ago

9 comments

rubyn00bieover 5 years ago
Like all ideologies, TDD has holes, and cannot be perfectly applied to the real world.<p>I think the the author is doing what TDD (or BDD) is fundamentally trying to get people to do, by writing such detailed requirements and specs: think about shit before they write the code.<p>When I take the time to properly spec something out down to the interface and calls, implementing it is almost always a cake-walk. If I do TDD to describe the interface, implementing it is almost always a cake-walk. But! I can only do these things if I truly understand the problem and its domain, if I have unknown unknowns my spec and tests will be wrong. C&#x27;est la vie.<p>Is TDD a panacea for software development problems? Nope. Does it help? It sure can.<p>Personally, I start writing something using BDD until it&#x27;s hobbling along (~40% done), and then I switch to TDD for the rest of it since I think it allows me to write correct software faster.
评论 #21453568 未加载
DerpyBaby123over 5 years ago
&gt;when the tests all pass, you’re done<p>&gt;Every TDD advocate I have ever met has repeated this verbatim, with the same hollow-eyed conviction.<p>My experience has been much different, in that I&#x27;ve never heard this mantra. I have heard for years &#x27;Red, green, refactor&#x27;.<p>I question what it is the author is railing against, as it doesnt seem to be the TDD that I&#x27;m familiar with.
Drikyover 5 years ago
I would laugh if it wasn&#x27;t so crazy that someone that doesn&#x27;t know how to do TDD was writing an article to say it sucks. EDIT: after reading the blog post a second time, I even think that the author doesn&#x27;t know how to write more classical unit-test.
评论 #21444790 未加载
评论 #21444524 未加载
bbodyover 5 years ago
I think TDD is over hyped, it is something many people seem to treat as a silver bullet. That being said I’m not sure if it is fair to say it is fundamentally wrong. As with many “silver bullets” it has its place, I’ve found it particularly useful when I’m writing a complicated function, it forced me to focus on inputs and expected outputs and I code to that specification. With regards to a changing specification, that is a problem regardless of when or who writes the tests, it is a part of life regardless.
评论 #21444684 未加载
al2o3crover 5 years ago
<p><pre><code> With this approach I write the tests after the odyssey of discovery, so the tests are only written to the final design </code></pre> Or if your manager tells you there&#x27;s another DOUBLE SUPER IMPORTANT TOP PRIORITY thing to do, the tests are written <i>never</i>.<p>Strict TDD is a technological solution to a management problem.
评论 #21446692 未加载
coorasse2over 5 years ago
This article is so full of bullshit that listing all the wrong things that Chris Fox wrote would make an even longer article. And no, this time I&#x27;ll not start making such a list because it would be a complete waste of time. This guy is completely ignorant and a very bad developer. Read books before start writing such shit.
jdlshoreover 5 years ago
Back in 2005, Microsoft published an article about TDD that was wrong. Not just a little bit wrong, completely and utterly wrong. I wrote about it at the time:<p><a href="https:&#x2F;&#x2F;www.jamesshore.com&#x2F;Blog&#x2F;Microsoft-Gets-TDD-Completely-Wrong.html" rel="nofollow">https:&#x2F;&#x2F;www.jamesshore.com&#x2F;Blog&#x2F;Microsoft-Gets-TDD-Completel...</a><p>The authors of that article described TDD the same way the OP&#x27;s polemic does: 1) write your tests 2) implement the tests.<p><i>But that&#x27;s not how TDD works.</i><p>Every complaint the author has stems from this misunderstanding.<p>If you&#x27;re interested in how TDD and related practices <i>actually</i> work, my talk from last month&#x27;s Pacific Northwest Software Quality Conference has been getting a lot of praise on Twitter. The whole thing&#x27;s worth watching, but the TDD-specific part starts at 15:21.<p>Whole video: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_Dv4M39Arec" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_Dv4M39Arec</a><p>TDD part: <a href="https:&#x2F;&#x2F;youtu.be&#x2F;_Dv4M39Arec?t=921" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;_Dv4M39Arec?t=921</a>
评论 #21449950 未加载
dhagzover 5 years ago
The only reason I like writing tests before code-complete is that I feel less likely to write my tests to the code. But really, that just amounts to defining the functionality of the app beforehand, but by way of unit&#x2F;system tests rather than some design document.
agsilvioover 5 years ago
I think TDD is fundamentally appropriate (and a blessing). I see it as generating proofs for claims that your software does X,Y,Z. This is invaluable to me and has given me confidence in rollouts to production.