Javarevisited
Published in

Javarevisited

Why Java Experts Avoid Mocks

What’re the correct mocking ways — fake, mock, or stub?

Photo by RF._.studio from Pexels

“Don’t use mocks.” ¹ “Mocks are stupid.” ²

Easier said than done. Mocks are everywhere. You can’t test without mocks.

What are the alternatives? Why mocks aren’t “one-size-fits-all”? How to use other test doubles?

What mock alternatives do…

--

--

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