News for hackers. Stuff that matters.
Re:Unit testing best practices by ajanuary on Tuesday November 06, 2012 @09:13AM (#4748429)
I'd suggest that if you need to document where is throwing the exception, you're doing too much work in the test.

Setup code should be pretty simple and stable, so should very rarely suddenly start throwing new exceptions.

If you need to pinpoint which bit of code under test threw the exception, you're probably testing too much in one test.

Of course, the advice changes when you're using a unit testing framework as a runner for integration tests.

There are no comments on this comment yet.