News for hackers. Stuff that matters.
Re:Controversial programming opinions by TillE on Wednesday August 29, 2012 @10:47AM (#4448806)
Indeed. Writing a unit test makes you think about what kinds of input your code might get. It's one of the few situations where you are specifically prompted to think of possible edge cases.

TDD doesn't work well in every problem domain. Sometimes you have to accept that parts of your code can't reasonably be unit tested, and isolate the bits that are testable. But where it is a good fit, it's magic. My favorite book on the subject:

http://xunitpatterns.com/

There are no comments on this comment yet.