Test Cases for functional testing are derived from the target-of-test’s use cases. Test Cases should be developed for each use-case scenario. The use-case scenarios are identified by describing the paths through the use case that traverse the basic flow and alternate flows start to finish through the use case.
In the following diagram, for example, each of the different paths through a use case reflecting the basic and alternate flows, are represented with the arrows. The basic flow, represented by the straight, back-line is the simplest path through the use case. Each alternate flow begins with the basic flow and then, dependent upon a specific condition, the alternate flow is executed. Alternate flows may rejoin the basic flow (alternate flows 1 and 3), may originate from another alternate flow (alternate flow 2), or may terminate the use case without rejoining a flow (alternate flows 2 and 4).
Following each possible path through the use case in the above diagram, the different use-case scenarios can be identified. Beginning with the basic flow and then combining the basic flow with alternate flows, the following use-case scenarios can be identified:
Scenario 1 - Basic Flow
Scenario 2 - Basic Flow >> Alternate Flow 1
Scenario 3 - Basic Flow >> Alternate Flow 1 >> Alternate Flow 2
Scenario 4 - Basic Flow >> Alternate Flow 3
Scenario 5 - Basic Flow >> Alternate Flow 3 >> Alternate Flow 1
Scenario 6 - Basic Flow >> Alternate Flow 3 >> Alternate Flow 1 >> Alternate Flow 2
Scenario 7 - Basic Flow >> Alternate Flow 4
Scenario 8 - Basic Flow >> Alternate Flow 3 >> Alternate Flow 4