top | item 23780187

(no title)

alecbenzer | 5 years ago

I meant expand on how those things make code easier to understand, not why unit testing causes you to adopt them.

discuss

order

projektfu|5 years ago

Mainly 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.