Jamie's Space


Quick Update on Unit Testing

Just thought I would add one more blog post to the millions of others floating around the net about how great unit testing is. I’ve spent the last week or so designing and implementing a cleaner version of one of the major modules of ArchAngel, and I couldn’t have done it without the regression test suite I wrote. It picked up all of those tiny little bugs that you just look over, but will cause you massive grief later on because they exist in parts of the code that “should just work”.

The number one lesson I’ve learned from this is to never assume anything works, even very simple things.

I started reading Pragmatic Unit Testing in C# with NUnit (http://www.pragprog.com/titles/utc2/pragmatic-unit-testing-in-c-with-nunit-2nd-ed) a few days into the design phase, and although I was doing some unit testing it pushed me into implementing more and better tests. It is a really good introduction to both how to unit test, as well as what to test. I highly recommend it for anyone working in C#. They have a Java/JUnit one there too, but I haven’t read that one.

In short: Unit testing saved my sanity this week.