HomeRumblingsSoftwareTravelingArchivesAbout
April 2008 Archives

Visual Studio Unit Testing Shame

I’m a big fan of unit testing as a bootstrap for running code in complicated systems.
Having a unit test framework allows you to run code that would otherwise require complicated deployment.
It’s also a good exercise in finding out just how much of the system you’re pulling along – how much configuration you have to do, how many dependencies you need to satisfy.
I usually end up using the framework for tests that would not qualify as unit tests: Tests start at the bottom and build up incrementally.
Ideally from unit to system tests you get a pyramid: Lots of very fast unit tests at the base covering a lot of ground. Composite tests higher up test your integration. The higher you go, the more complicated your infrastructure gets, but the number of tests should decrease based on the confidence that the simple fast tests give you.

And speed is where Visual Studio falls down, breaks it’s neck and asks you to pay the bill.
I have a 1 GB RAM VM running Windows XP with Visual Studio 2008. A single unit test, for a single method takes between 11 and 18 seconds to complete.
The actual tests require miliseconds to complete. The rest of the time is – I guess – spent in hooking up the whole VS apparatus.
Using mstest on the commandline cuts the execution time in half but triples the hassle.
(only to be pedantic: the complete rutema test suite – unit tests and system tests – on the same VM runs in a fraction of that time – about 7 seconds – including any interpreter startup times)

This kind of performance completely defeats the purpose of unit testing: people will just not build any tests if it takes so long to get them running, your technical debt increases and you find yourself with software that will not run.
Microsoft really needs to address this point.

Posted by Vassilis Rizopoulos on Apr 07, 2008

Euruko 2008 Roundup

Well, I can put it all in a sentence: Euruko was fun! The guys that organized the whole thing did a fantastic job for the ~300 geeks in attendance. I enjoyed my talk on "rutema":http://patir/rubyforge.org/rutema , even while I panicked when I realized that the projector was showing 800x600 instead of the 1024x768 my slides were set for. It was very nice to put some faces on names and I enjoyed the talks on JRuby, David A. Black's "per object behaviour on ruby" and "Synthesized testing" by my fellow greek George Malamidis. "Grab the slides":http://www.euruko2008.org/pages/2-program while we wait for the videos. And while we were at it, I got to fix a few bugs for rutema (never, ever update your gems before a presentation), check if it runs on JRuby (not there yet, but it's coming) and "release":http://patir.rubyforge.org/rutema064.html

Posted by Vassilis Rizopoulos on Apr 07, 2008