3 ms·
Mocks are for objects, stubs are for responses and ‘fakes’ are basically the same thing as mocks.
by Aeolun 4y ago
Mocks are for objects, stubs are for responses and ‘fakes’ are basically the same thing as mocks.
- Cyph0n 4y agoFakes are not mocks. A fake is an actual (simplified) implementation of the dependency. For example, if your dependency is a distributed key-value store, a fake would expose the same API but using an in-memory hashmap under the hood.
- Aeolun 4y agoYeah no, that’s a mock. At least, that’s been a mock ever since I started prgramming 15 years ago. Only later did libraries that automatically mock dependencies appear (and I presume people suddenly felt a need for a new name for not-automatically mocked dependencies?