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.

Is unit testing doomed?

6 pointsby procyonalmost 17 years ago

3 comments

inventedchipalmost 17 years ago
I would not say so (and the article itself presents several compelling arguments) - developers & management just need to change their attitude a bit. Getting defensive about one's code is as old as "hello world" itself and once that is brought under control and the developer starts seeing the code as a "user" would - good unit test plans usually result. The benefits of unit-testing are easy to understand but difficult to quantify which is why management in its TTM focus tends to overlook it - you need a believer in the ranks to champion that cause. Fortunately there are plenty of those around so the questions / calls are a little premature.
评论 #273349 未加载
nakajimaalmost 17 years ago
The advantages described by the author here are the same ones you always hear in discussions about the benefits of unit testing (bugs are caught sooner, you feel better about your code, etc.)<p>The <i>real</i> benefit to unit testing (at least from my experience) is that it encourages you to write better code up front. By thinking in terms of the smallest possible units, you don't bite off more than you can chew. As a results, your code tends to be more decoupled, more modular, and more logical (unit testing helps you organize responsibilities in your code).<p>For this reason, even if I had to delete every test I wrote after I made it pass, I'd still write a failing test before writing any implementation code. Of course I'd much rather prefer to keep my test suite, since it does provide the benefits discussed by the author. While no amount of unit tests will reveal <i>every</i> bug in your code, the quality of code I've written after writing a failing test first is vastly superior to code I've written sans-test.<p>Your mileage may vary, but if you haven't tried it yet, I suggest you give it a whirl.
gaiusalmost 17 years ago
I'd be willing to bet that a class of problems caught by unit testing in Ruby/Python simply don't exist in Java due to its strong typing.<p>Of course the flipside of that is that Java's design patterns aren't nearly as important in Ruby/Python as they have functional programming capabilities out-of-the box. Swings and roundabouts.
评论 #273452 未加载
评论 #273506 未加载