25 Sep 2007

To Test or not to Test private methods? That is the question !

We were talking about whether to test or not private methods, making them public to do the tests. I recommend this post of Michael Feathers.

I also recommend the "Mock" testing technique to avoid doing surgery on you objects. Using fake objects to record what methods are call on this object and then trigger the mock.assert() on this object.

Technorati tags:

No comments: