Training Day: Unit Testing


Yep, I am on Unit Testing again. Expect some writing about it, because I think it's kind of cool.

It's a new shiny toy. Well, maybe it's not too new, but I have been given the chance to apply it massively to a serious project and... I love it.

My company is having this training day to let the developers who are not in my project to get their grips on it (and let them play with it as they couldn't in my introductory session on the subject), as it will probably be pushed into new projects one way or another.

My team leader and I had this crazy idea to give them a piece of running software and ask them to unit test it. Of course it will have some hidden potholes so they can feel the pain of a not properly factored code.

He suggested that, besides having this test-last, test-aside, call-it-what-you-want-of-invent-an-acronym, we might give them a small assignment of test-first-code so they can try it and decide which suits them better.

If you ask me my opinion, I feel more comfortable with my test-aside style of testing in which I design my software for testability, write the code first, and then, before performing integrated test of any kind, I add my unit tests. Yes, I tried TDD and I don't like it that much. I still feel naked without my intellisense...

Test-first, test-last, test-aside, test-in-front... but test your code in an automatic, repeatable manner. The guys maintaining that code would love you, and love amongst developers is rare nowadays.

More to come...