O'Reilly logo

Effective Unit Testing: A guide for Java Developers by Lasse Koskela

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

Chapter 3. Test doubles

 

In this chapter
  • What can we do with test doubles?
  • What kind of test doubles do we have at our disposal?
  • Guidelines for using test doubles

 

The concept of stubs or dummies has been around about as long as we’ve had the ability to structure software code into classes and methods. Once the primary reason for creating such utilities was to serve as a placeholder until the real thing became available—to allow you to compile and execute one piece of code before its surrounding pieces were in place.

These objects have much more diverse purposes in the context of modern developer testing. Instead of merely allowing the compilation and execution of code without certain dependencies present, the test-infected ...

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