Chapter 6 introduced a technique to encapsulate functionality in such a way that we could override it for better control while testing. This chapter elaborates on that approach with several variations. We use encapsulation to create seams in our code that can then be exploited for verification. We also look at the use of test doubles (see the sidebar “Test Doubles and Interface-Based Design”) to help us.
18.117.137.12