A power adapter: 220V AC on one end, USB on the other

We all want to have fast, reliable and simple tests (and code). One thing that gets in the way of all of those good things is that the code that we want to write depends on external systems, such as databases, web services, etc. We then look to mocks to take care of the dependencies, and here is where many find that their code goes BOOM.

I think the main reason why people have poor results with mocks is that they miss a subtle thing. It’s in one of the original papers on mock objects:

Only mock types you own.

Matteo Vaccari

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store