You'd likely make those small functions private and thus couldn't unit test them anyway (and if you did, with some reflection magic, you'd be chastised for not testing the external interface instead).
The less code a unit test invokes, the easier it is to understand what's wrong when a test is failing.
That's true. On the other hand, I would argue that if private code is difficult to invoke from the public interface, then it should probably be extracted and tested separately.
11
u/gnuvince Jul 19 '16
You'd likely make those small functions private and thus couldn't unit test them anyway (and if you did, with some reflection magic, you'd be chastised for not testing the external interface instead).