3 ms·
Couldn't agree more. I've done a few "coding dojo" sessions where my team and I start from scratch and write a new set of mock-based tests for a piece of existi
by theptip 7y ago
Couldn't agree more. I've done a few "coding dojo" sessions where my team and I start from scratch and write a new set of mock-based tests for a piece of existing code, and when it starts to get gnarly, it's always been because of an inconsistent interface, or confusing API of the code under test.
Bob Martin talks about this a lot; your UTs should be thought of as first-class clients of your objects' APIs. If something is hard to test, it's probably hard to use, or abstracted at the wrong level.