3 ms·
1. Interfaces allow swapping out objects. 2. Mocking is a bad idea even in languages that support it well. A better approach, when you do need to deal with fa
by itamarst 9y ago
1. Interfaces allow swapping out objects.
2. Mocking is a bad idea even in languages that support it well.
A better approach, when you do need to deal with fakes, is verified fakes: write two versions of an interface, and a test suite for that interface to ensure the fake acts the same as the real thing.
More here: https://codewithoutrules.com/2016/07/31/verified-fakes/ https://codewithoutrules.com/2016/07/31/verified-fakes/