Testing of Error Cases
In the last chapter, you saw how white-box testing techniques improve test coverage by examining how the code works. Understanding your application’s implementation lets you write more detailed tests covering more of the code behavior, in addition to the checks identified by black-box testing. This chapter examines how best to test the final aspect of core behavior: the code’s response to error conditions. There are still many other aspects, such as how usable, maintainable, and secure the application is, but this is the last section of testing focusing on the code’s active behavior, testing what it should do in different situations.
In this chapter, you will learn about the following topics:
- Expected versus unexpected failures
- Failing early
- Failing as little as possible, to avoid defect cascading
- Failing as specifically...