4 ms·
I really don't understand why this post says that "mocks are a smell". For the last few years I've been mostly a Java developer and I've settled on a style of
by a-priori 11y ago
I really don't understand why this post says that "mocks are a smell".
For the last few years I've been mostly a Java developer and I've settled on a style of using a very mock-heavy testing style focusing on unit testing the interactions it has with other objects in the system. I use Mockito (http://mockito.org/ http://mockito.org/) to automatically generate mock objects from a class/interface.
When you combine it with dependency injection you get a testing workflow where you can fully isolate the unit-under-test from the outside world and rigorously verify its interactions with its peers.