Are your test classes using an "ObjectMother"?

I recently came across a paper written by several ThoughWorkers on the ObjectMother pattern. The ObjectMother pattern seeks to make the creation of objects for testing simpler by reducing code duplication, ensuring fresh objects are created for tests, and ensuring tests always clean up after themselves. Although I just recently came across this pattern I've been using a variation of it on many of my projects over the last year or so. Consolidating my individual factory methods for creating test objects (that sometimes appear within a Test Fixture) into a ObjectMother object is something that I'll be looking to try on a project soon.

Post a Comment

 
 
Prove you're not a spammer: 
9 + 8 =