Tijmen 05:23, 1 June 2009

I've finally finished reading the excellent Working effectively with legacy code by Michael Feathers. It has been quite a struggle but that's merely because of the amount of useful information in it.

 

The author declares all code that is not under test to be legacy code. Ayende (author of Rhino mocks) basically based his mocking framework on the concepts in the book. Not surprisingly, he recommends the book as well.

 

I recently worked on an application written by another team that had zero unit tests. It did have a winforms test app included but that was merely for integration testing and required quite a bit of tweaking before anything useful could come out.

I started with isolating large chunks of functionality using Dependency injection with Unity. I then used StructureMap's automocker to bring most of the codebase under test (+80%).

Adding the required features was made much easier when most code was under test. This inspired me to throw a talk on TDD at meet the Masters in Microsoft at Avanade.

 

I´ll be hosting another talk about PEX next week and in preparing I will be diving into the book´s concepts. As most of these are written for either Java or C++, my focus will be around utilizing the same concepts in the beautiful world of .Net.

Comments are closed.