Set your name in
UserPreferences Referenced by DoMockBoysDreamOf...
JSPWiki v2.0.36
|
I value MockObjects as an excellent tool, and I use and promote their use daily at the office. Please don't read this as slating the idea, but I want to pick up on TimM's comment on DoMockBoysDreamOfAnAllTestsPassWorld on TestsMustCommunicateTheIntent. Whilst I do agree that TestsMustCommunicateTheIntent of the code under test, I'm not convinced that it is only with MockObjects that this is the case, ie: vanilla test cases can also communicate just as well (and in fact sometimes can an explicit assertEquals be more readable than a hidden myMock.verify() ?). Yes, MockObjects most definately offers an approach to encoding tests, and given one is used to reading mock objects then the level of readability is maintained between tests. However expressing comprehension is less tangible and I guess dependant on each reader's interpretation. I'd favour stating the MockObjects ensure readability through a consistent approach to testing, rather than comprehension of the code. I simply want to clarify here that MockObjects isn't a panacea, and as such I tentatively offer that:
-- PaulS TestsMustCommunicateTheIntent, MockObjects are for communicating the intent and testing the dependencies/interactions between objects. It depends what intent you are trying to communicate with your tests as to whether to use MockObjects; is it the end result of some code, or the interactions between objects? IvanM
|