← Back to Upcase

Fear of Mocks and Stubs


(Rajeev N Bharshetty) #1

In our current Project we have employed Classic way of testing. We have this fear in our project as to usage of Mocks and Stubs will increase the difficulty in refactoring the code. I have read around some articles which suggests using heavily nested mocks and stubs will cause difficulty in refactoring. Could you provide some examples or point me to some resources where we can employ this Mockist style of TDD and not be afraid of it.

Thanks


(Andy Waite) #2

Heavy usage of nested mocks and stubs is usually a sign that that the design can be improved, for example by modifying interfaces or extracting out additional classes.

Have you worked through the Test Doubles trail? And watched Stubs, Mocks, Spies and Fakes?