June 2019
Beginner to intermediate
770 pages
19h 24m
English
We generally think of testing as something applied to the final code (in Chapter 17, Design for Testability, we'll look at automated testing in detail). However, we can also apply a test to a SOLID design. The test is to replace a given class with an equivalent class to provide an alternative algorithm to accomplish the same purpose. If we've done our design job well, then a change to one class should have a minimal splash with few ripples.
As a concrete example, consider the Domino class shown earlier in this chapter, under the Interface Segregation Principle section. We used a NamedTuple to represent the pair of numbers. Some alternatives are possible:
Read now
Unlock full access