CHAPTER 14

USE CASES, TEST CASES

Ian Alexander

Scenario Plus, London, UK

USE CASES define the expected behaviours of systems in a branching structure consisting of the primary and alternative/exception scenarios. To generate deterministic, straight-line Test Cases, it is necessary to find a suitable set of paths—Test Scenarios—through each branched Use Case, at least covering all the branches and often also meeting more stringent criteria. Therefore, one Use Case can generate and trace several Test Cases. In addition, test conditions may need to be varied to take account of different operating environments. So, each Test Scenario discovered from the Use Cases may need to be executed in not one but a whole Class of Test Cases, whose members differ according to the environmental conditions in force.

APPLICABILITY

In principle, Use Cases can guide the design of tests for any type of system. In practice, this is most important for complex novel systems whose patterns of use are not predictable from previous experience.

Scenario-based testing is most clearly appropriate for user-level acceptance testing, in which the test cases should resemble the scenarios originally elicited from system stakeholders. It may also be useful for testing sub-system behaviour, and for tests of those system qualities such as maintainability in which a scenario approach makes sense.

POSITION IN THE LIFE CYCLE

KEY FEATURES

  • Use Case paths are traversed to generate Classes of Test Cases (abstract Scenarios) ...

Get Scenarios, Stories, Use Cases: Through the Systems Development Life-Cycle 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.