7.3. Guidelines for testable design

The following is a set of do’s and do not’s I’ve gathered and whose importance I’ve learned through repeated yak shaving.[9] They aren’t in any particular order, and none of them is a universal truth—just things to keep in mind so that you think twice before deciding to go against these guidelines.

9 Yak-shaving defined, http://en.wiktionary.org/wiki/yak_shaving.

With that disclaimer, let’s start with some guidelines that relate to what we talked about in the previous section.

7.3.1. Avoid complex private methods

There’s no easy way to test a private method. Therefore, you should strive to make it so that you don’t feel the need to test your private methods directly.

Note that I didn’t say you shouldn’t test ...

Get Effective Unit Testing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.