Wednesday, November 4, 2009

Nose: multiprocess

One of the coolest things about Nose's multiprocess plugin (aside from the fact that it can run your whole test suite in a fraction of the time on a quad core) is that it discovers, by way of causing your tests to fail, many of the areas where you didn't exactly write religiously-pure unit tests.

This is a rather ad-hoc and incomplete method of finding these problems, though. I'm reminded of a tool I played with in college that intentionally ran a program's threads in every possible order looking for deadlocks: how about running your unit tests in every possible order to automatically discover the dependency problems?

Of course there's a combinatorial explosion to worry about, but it might be worth the CPU cost every time you add a bunch of new tests.

Be the first to reply!

Post a Comment

By submitting a comment you assert that it is your own original work and agree to grant a non-exclusive licence to Brandon Thomson to display it on log.bthomson.com.