An interesting blog post about Mockito (and other mocking frameworks)
I’ve recently joined the mockito google group and this link was posted recently.
http://rrees.wordpress.com/2009/04/12/three-little-mockers
It mainly compares Mockito and JMock and how the author thinks that Mockito encourages developers to be lazy and allows classes to grow fatter in terms of functionality and collaborators. The author also thinks that Mockito encourages Test Driven *Development, while JMock encourages Test Driven *Design. Don’t forget to read the comments too, that’s where the drama’s at.
What do you think? I haven’t used JMock, so I can’t speak myself. But to those who have, does JMock compel better code design because it increases the amount of noise in the code? Do you think there’s a difference between Test Driven *Development and *Design?
Another interesting note is that there was a ThoughtWorks team in the same location as the author, and they were pushing for Mockito



I would characterise my opinion as being that Mockito does not necessarily “encourage” developers to be lazy but that it’s ease of use carries with greater risk of the issues you mention happening.
I also strongly disagree that there is an issue of JMock “noise”, there is the Java noise around anonymous inner classes and my concern is that it is not noise that gets erased but the intent of the code.
rrees
April 21, 2009 at 9:58 am
I appreciate your opinion and I don’t mean to be rude but I would like to hear from other people given that you were the one who wrote the blog post
Dahlia Bock
April 21, 2009 at 10:12 am
[...] since I was introduced to Mockito about a year ago, I’ve been a big fan. I wrote a couple of posts about it and promised a long, long time ago that I would post an example of a test written in [...]
Mocking: Mockito vs EasyMock example « Dahlia Bock
August 24, 2009 at 4:05 am