O'Reilly logo

Test-Driven Java Development - Second Edition by Viktor Farcic, Alex Garcia

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

Terminology

Terminology can be a bit confusing, especially since different people use different names for the same thing. To make things even more complicated, mocking frameworks tend not to be consistent when naming their methods.

Before we proceed, let us briefly go through terminology.

Test doubles is a generic name for all of the following types:

  • Dummy object's purpose is to act as a substitute for a real method argument
  • Test stub can be used to replace a real object with a test-specific object that feeds the desired indirect inputs into the system under test
  • Test Spy captures the indirect output calls made to another component by the System Under Test (SUT) for later verification by the test
  • Mock object replaces an object the SUT depends ...

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