O'Reilly logo

The Art of Unit Testing, 2nd Edition by Roy Osherove

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

6.4. Isolation framework design antipatterns

Here are some of the antipatterns found in frameworks today that we can easily alleviate:

  • Concept confusion
  • Record and replay
  • Sticky behavior
  • Complex syntax

In this section, we’ll take a look at each of them.

6.4.1. Concept confusion

Concept confusion is something I like to refer to as mock overdose. I’d prefer a framework that doesn’t use the word mock for everything.

You have to know how many mocks and stubs there are in a test, because more than a single mock in a test is usually a problem. When it doesn’t distinguish between the two, the framework could tell you that something is a mock when in fact it’s used as a stub. It takes you longer to understand whether this is a real problem or not, ...

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