4 ms·
> 1. Only test the behavior from the user/consumer's perspective, do not test implementations. (Therefore the internal can be refactored without deleting tests.
by tpxl 5y ago
> 1. Only test the behavior from the user/consumer's perspective, do not test implementations. (Therefore the internal can be refactored without deleting tests.)
Sometimes you still need to test implementations. We had database writers/readers that automatically retried on failure/disconnect/failover/whatever and you can't test those by testing the API.
- namelosw 5y agoThanks for pointing it out. I was not clear that I was referring to the tests related to business requirements (which is the majority of the tests). Infrastructures could be treated like third-party modules as they could be tested like any open source project separately.