4 ms·
Mocking is hard really hard, in order to mock something you need to imitate its functionality and interface. This means the mock is inherently tightly-coupled t
by gitgud 7y ago
Mocking is hard really hard, in order to mock something you need to imitate its functionality and interface. This means the mock is inherently tightly-coupled to the implementation, which is now another dependency in your system.
After trying to work with mock databases and file systems, I've personally found that there's no substitute for the real thing. There's much less maintenance and greater reliability in spinning up a test environment with the exact implementation that will be used in the production environment.
There are cases where mocks are the only practical solution, (embedded systems, distributed systems) but mocking is surely the last resort...