3 ms·
I find simulated fakes that have behaviour that is testable with the same test between a real implementation and fake one to be really superior. It's even bett
by necovek 3y ago
I find simulated fakes that have behaviour that is testable with the same test between a real implementation and fake one to be really superior.
It's even better when you've got control of the external dependency (open source project, public API, or internal project) when you can implement something I call "real fakes": use as much as possible from the real code that's fast (i.e. input validation, output adaptation, same basic logic), and have that project export a fake service as a library for easy reuse. This avoids the most common problem with fakes: outdated simulated/mocked implementations.
Eg. wouldn't it be wonderful if every project had a "real fake": imagine Postgresql providing really fast fake-pg from the same codebase and tracking their releases, or Amazon SQS providing fake-sqs instead of having to rely on externally provided simulated fakes?