DEV Community

loading...

Discussion on: Prefer Fakes Over Mocks

Collapse
seankearon profile image
seankearon

Thanks for another great article, Alexey! I always prefer using fakes than mocks in my tests wherever it's not possible to use the actual components. I think people often don't think further than putting an interface on everything and then writing some crazy mocking code in the tests. Both of these practices can reduce the readability of the code in the long term - especially so for the tests, which are what you want to be the most readable parts of the code base!