What is Nostr?
Henrik Jernevad /
npub1lh4…qm65
2024-11-19 06:13:58

Henrik Jernevad on Nostr: Only mock your own interfaces. That is one of my rules of thumb for writing robust ...

Only mock your own interfaces. That is one of my rules of thumb for writing robust unit tests.

When you mock/stub third-party interfaces, you will encode your expectation of what the real component would do, which may differ from what it would actually do. If you failed to anticipate the correct behavior when you wrote the code under test, you will likely encode that same incorrect behavior in your mock.

https://henko.net/blog/only-mock-your-own-interfaces/

#programming #unittesting #testing
Author Public Key
npub1lh4njeap95994lk7drgky3msmq4fpxc6kssvvulpfjvqagkgmvqswuqm65