I just watched this funny YouTube Video about unit testing (it’s Hitler with fake subtitles chewing out his team for not doing good unit tests–skip it if you’re humor impaired) where stubs get roundly criticized. But I don’t understand what wrong with stubs.
I haven’t started using a mocking framework and I haven’t started feeling the pain from not using one.
Am I in for a world a hurt sometime down the line, having chosen handwritten stubs and fakes instead of mocks (like Rhinomock etc)? (using Fowler’s taxonomy)
What are the considerations for picking between a mock and handwritten stub?
There is nothing wrong with stubs, there is room for stubs, mocks… and spies. All are “test doubles”, but with different purposes as explained in Mocks and Stubs aren’t Spies:
PS: Mockito – The New Mock Framework on the Block is worth the read too.