This is an eye-opening article about the different type of objects you can use in testing. I’ve been making good progress lately with mock objects. But I readily admit that my tests are way more rigid and brittle than I’m happy with. Unfortunately (well, fortunately for me) I’ve been hearing about it second hand from my coworkers — that my tests break and are a pain in the ass to fix.
Note I say “coworkers” and not “friends”.
Here are a couple of good articles about the whys:
I’ve been enjoying MockEasy because it’s just neat technology, and I found the interface to be super intuitive and easy. But I worked with mockito today, and found the failure reporting to be a lot clearer and easier to fix when something goes wrong. I might switch over to mockito, because it’s better suited for the “Test Spy” pattern like the articles above mention.