O'Reilly logo

Quality Code: Software Testing Principles, Practices, and Patterns by Stephen Vance

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Behavioral Encapsulation

A similar set of considerations occurs with methods and subordinate objects. As the implementation of an object’s behavior grows, the size and complexity of its methods increase, leading to refactoring. This refactoring creates new methods and classes, some of which represent purely internal models of behavior within the object. The Extract Method [REF] refactoring creates restricted methods. The Extract Class [REF] refactoring creates a new representation that may not need to be seen outside of the original context.

Refactoring like this tames the size and complexity of the software. However, the very size and complexity that suggests refactoring also suggests the need for testing. We may simplify a component or unit ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required