If you're thinking about doing Test-Driven Development, you may ask yourself how long it should take for your unit tests to run. Faster is always better.
The time it takes to run tests has various effects. When the unit test suite slows down:
There’s a yahoo group on TDD, frequented by PhlIp, Ron, and others from the Agile community. One bit of guidance that I’ve seen there is that unit tests should run in less than a minute. When they start to get slow, and you find the above bullets are happening, it’s time to refactor your code, refactor your tests, and do perf. improvements of both.
One thing to keep in mind is scale of project: at Microsoft our teams are larger, our ship cycles are longer, our plans are grander. I can’t imagine the full unit test suite for all of Visual Studio running in less than a minute. But I could see it happening per-team, or even smaller. I figure that when code is decoupled & has good unit tests, you know which tests you need to run for which class.
Running the full set of unit tests + integration tests before checkin is a good idea, and part of XP. Keeping the whole checkin verification process under 15 minutes is good, too.
I don’t work in a situation like the one I’ve described, but we’re getting better.