29 March 2005

Test speed limits

Marty Andrews has written about how fast you should expect your test suites to run. He covers unit, integration and system tests.

I find these kind of figures put a useful speed limit on automated tests. If you're trying to write a test that slows your suite too much, you've got two options: push the test down to the next level (as a integration or system test), or mock/stub the object.

To figure out which is the right choice, think about what kind of testing you're actually trying to perform (if you really talk to the database you're testing integration, aren't you?), and that should give you the right answer.