2 ms·
I think we're in agreement, mostly. One of the perennial debates is what is a unit? Is it a class, a module, a compilation unit, a library, a function? If it's
by Jtsummers 5y ago
I think we're in agreement, mostly. One of the perennial debates is what is a unit? Is it a class, a module, a compilation unit, a library, a function? If it's a function, do we need to test every function? What about functions that only get used by our public interface but aren't our public interface? Sometimes it makes sense to test them, but often not. In the end I only write unit tests against the exported methods/functions of a class or module and consider the unit to be the class or module and its public interface, anything below that may get a test if its sufficiently complex, but often not because there's no need (it's exercised by the tests I'm already writing, or it's dead code).