Wednesday, January 16, 2008 Posted by Marc Esher at 6:38 PM
I decided to make a case study out of the development for Issue 48 i.e. making private methods testable. I took screenshots at every step of the way and plan to document it all. I think it'll provide insights into the tiny little iterations and sometimes inconveniences one encounters when unit testing; it'll also show how to easily overcome them. Just as importantly, it should demonstrate the tremendous benefits of unit testing. I find that what I like about mxunit is that for the most part it doesn't make it too tough to see the information I need to see when I'm developing. I like cfdump. I like seeing the data I'm dealing with (does the string have periods or back slashes? what keys are in the getMetadata() struct for this here function, anyway?) But more on that later. Oh, and how to test private methods, i.e. private functions, i.e. <cffunction .... access="private"> (or access="package")? That's pretty easy. Well, now it's easy, anyway.