2 ms·
I meant expand on how those things make code easier to understand, not why unit testing causes you to adopt them.
by alecbenzer 6y ago
I meant expand on how those things make code easier to understand, not why unit testing causes you to adopt them.
- projektfu 6y agoMainly it reduces surprise. If you call an interface with implicit dependencies, you won’t know if why it’s breaking without debugging and making sure it sets up its dependencies properly. If you call a testable interface with explicit dependencies, you can mock out those dependencies to debug parts individually.