3 ms·
You want to write the tests at the boundary where you want stability, where you want to prevent change. Sometimes you don't want to prevent change because it's
by itamarst 9y ago
You want to write the tests at the boundary where you want stability, where you want to prevent change.
Sometimes you don't want to prevent change because it's an implementation detail. That can mean private APIs, but also whole layers of abstraction.
Common layering, for example, is:
1. Low level operation that needs to be stable, so needs tests.
2. Medium level abstraction layer, not core business logic and builds on stable layer.
3. High level abstraction, the exposed public business logic API. Public API so needs tests.
Medium layer does not necessarily need tests in this case.
I have a bit higher level discussion of this in a talk I gave in May (first video): https://codewithoutrules.com/talks/ https://codewithoutrules.com/talks/