Thursday, October 26, 2006

Unit testing

I'm starting to write a lot more code at the moment that is dependent upon other code that I've written and running up against problems where one change I make breaks something else.

Now I've quite happily been able, until now, fix any problems that I know will occur as there's only been me working with the code and there, quite honestly, hasn't been that much of it.

Now that I'm working on some bigger deliverables I've discovered the need for proper testing.

I've looked at unit testing in the past and indeed my last job used it.  Or at least tried to use it - the project manager decided that his way was the way that it was being done.  Even if he wasn't quite as correct in his assumptions as he could be.  The immortal quote of "I don't understand UI" was uttered - not what you want on a large web application project.

So I've started looking at testing.  In particular unit testing.

My good friend Dan has been contributing to MbUnit and I attended a talk by Phil Winstanley last night all about unit testing.  Got some really good ideas.

I'd already used NUnit in the past so the change to see MbUnit in action was good.  Especially interesting was the Ruby and Watir stuff that Phil demonstrated.  He also talked about a new Microsoft testing environment that you can use to test web sites without actually firing up a browser.

The problem is still the age old one - any time I'm writing test code I'm not writing real code.  Perhaps I need a trained monkey to write all the tests?!?

No comments: