Chapter 2. Testing Design Patterns

While we are all very familiar with general object-oriented design patterns, testing design patterns are not nearly as well understood or prevalent because the mechanics of writing tests is easy, and almost any testing framework we use is likely to be fairly simple and easy to understand.

More interesting than just writing tests, however, is writing tests that will stand the test of time, tests that will handle future requirements and changes, ones that can be easily maintained by any new developers who might join the team or take over the code base.

In this chapter, we’ll examine a number of patterns and common problems that have emerged through practical applications of testing. Starting with failure testing, ...

Get Next Generation Java™ Testing: TestNG and Advanced Concepts 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.