Discerning Intent

We did a couple of things in this chapter. The obvious one is that we took a common—although sometimes controversial—design pattern and broke down how to test it while preserving the essence of its intent. More importantly, though, we recognized that some of the patterns we have been taught to use without question require closer inspection to test. To take this a step further, using accepted design patterns idiomatically—as a chunk6 or out of habit—at a minimum complicates your testing—perhaps unnecessarily—and can unintentionally entangle concerns.

6. “Chunking” is a concept in the study of second-language acquisition. Effective language learners acquire “chunks,” or sequences of words, as a unit rather than limiting their ...

Get Quality Code: Software Testing Principles, Practices, and Patterns 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.