Scenario Based Testing

Mark Kampe

1. Introduction

Testing is about assessing and developing confidence about the quality of the product being tested. Good tests shake out important bugs. Efficency in test development can be measured by the number of new bugs found per hour invested in new test development.

Imagine, for a moment, assume that:

Given those assumptions, developing additional test cases based on the requirements and specifications would not seem likely to offer a high return on investment. Such test cases would not so much be looking for bugs in the component as gaps in the test plan ... and that is what the review was for. There probably aren't very many (such) bugs left to be found, and what few there may be are likely to be in obscure corner cases. If we want to improve and gain additional confidence about the quality of our component we are going to have to find a new basis for additional tests.

When we were discussing representations for requirements, use cases were suggested as an alternative to declarative specifications. Use cases (or user stories) offerred a few compelling advantages:

They may have even been the real-world sources from which the declarative requirements and specifications were derived. Such use cases can also become the basis for test cases.

2. Developing Testing Scenarios

Start with the original use cases:

Carrying out such a scenario might assume that there was already information in the system (e.g. about a particular customer, order, or stock item). But defining new stock items, adding them to the inventory, setting up new customers, and placing orders are each use cases in their own right. We can construct larger scenarios (sometimes called sagas which combine numerous use case stories in long chains of inter-dependent test cases. Such scenarios can become long and complex, and encompass almost all of the functionality of the product. Scenarios can be used in even more complex ways:

3. Conclusion

Scenario based test cases are: