TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Are You Wasting Time With Test Driven Development?

6 点作者 sethrq将近 15 年前

1 comment

jameskilton将近 15 年前
For all these points, the real answer is "you're doing it wrong." TDD is supposed to, over the course of the project, allow faster development, allow easier and safer refactoring, and overall allow you to feel confident in the system you've built.<p>My personal experiences have shown the following:<p>* If you're not allowing yourself to write prototyping / exploratory code without tests, you're doing it wrong.<p>* If the first thought when writing tests for a method / class / etc is "What do I need to mock", you're doing it wrong (mock over-usage is the worst TDD mistake I've ever seen).<p>* If the tests take too long to run, you're <i>definitely</i> doing something wrong.<p>I've run the full gamut of extreme white-box testing to full black-box testing. There are merits to both, and there's a time and place for both, but anyone who adheres to strict ideals isn't developing good software, they're doing Agile masturbation.<p>That said, anyone writing production code <i>without</i> a test suite is making an even bigger mistake than doing any of the above. Building a good test suite is a very hard problem, and you really need to tailor what you build and how you test with your team and your product.
评论 #1581068 未加载