Adjust Visibility
Many of the things we have learned about encapsulation of software designs do not account for testability. We are encouraged to make things private, to provide access through methods, and to wrap behaviors in extra levels of indirection. While most of these heuristics, designs, and patterns suggest best practices and provide useful abstractions, very few account for the means and mechanisms to test them thoroughly.
Take simple procedural decomposition within a class, for example. Breaking an interface method into logical, purposeful submethods involves the creation of private methods according to the guidelines of encapsulation. However, if these submethods are as logical and purposeful as they should be, then they are also ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access