3 ms·
I would say that testing only the public contract is generally very helpful. When the logic gets super complex, I would think that a good comprise is to modula
by omegalulw 5y ago
I would say that testing only the public contract is generally very helpful.
When the logic gets super complex, I would think that a good comprise is to modularize your code - and test the public API of each module. A good heuristic is to see if that modules are (or could be) helpful by themselves in the future.
You then write tests for a module assuming it's dependents cover their edge cases.
- quickthrower2 5y agoAs I wrote it I thought the same thing! I think some of the problem was org friction of adding a new module, getting approval to do so. This was a place with about 400 devs so they could really let anyone freely add modules and waiting for architecture approval would take too long for a typical ticket.