O'Reilly logo

JUnit Recipes: Practical Methods for Programmer Testing by J B Rainsberger, Scott Stirling

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 14. Testing design patterns

This chapter covers

  • Testing the Observer/Observable pattern
  • Testing the Singleton pattern
  • Testing the Factory pattern
  • Testing the Template Method pattern

Design Patterns have been around for quite a long time, now—enough time to have become part of the common vocabulary of Java programmers. As we become more comfortable discussing designs in terms of the patterns we apply, we begin to wonder what kinds of tests are most appropriate when we apply those patterns. For example, if there is a special set of cases that one typically needs to cover in order to effectively test the Flyweight pattern,[1] then we would like to know about them. As we plan to apply the pattern, we can be sure to include the corresponding ...

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