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 Cargo Cult

3 pointsby d0ugalover 12 years ago

1 comment

jones1618over 12 years ago
tl;dr - Developer writes a legitimate test to prove Test Driven Development will force us to write decent code. We write code that cheats by using knowledge of the test to pass in the lamest possible way.<p>This proves that TDD is worthless? Really? I agree with his view that TDD has a "behaviorist" mindset if approached in the most superficial way. But, his example only shows that while you can go out of your way to perfectly cheat a unit test, if they had programmed a sensible component (that also happened to pass the unit test) they'd have some assurance that it was in good working order.<p>That's all that unit tests do. Create simple tests to assure basic functionality. Add more complex tests to verify more complex functionality and wider range of test cases. Rinse and repeat.
评论 #5269865 未加载