Chapter 4. Testing Exceptional Flow

Special care has to be taken when testing a component's functionality under exception-raising conditions. In this chapter, you'll learn how to use the various capture and verification possibilities and discuss their pros and cons. As robust software design is one of the declared goals of the test-first approach, we're going to see how tests intertwine with the fail fast strategy on selected boundary conditions. Finally, we're going to conclude with an in-depth explanation of working with collaborators under exceptional flow and see how stubbing of exceptional behavior can be achieved. The topics covered in this chapter are as follows:

  • Testing patterns
  • Treating collaborators

Testing patterns

Testing exceptional flow ...

Get Testing with JUnit now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.