In MxSuite, a "Scenario" is an ordered group of TestCases that are related to each other. How they are grouped is a choice made by the users of the tool. For example, a Scenario could consist of:
•TestCases that demonstrate that functional requirements are met (positive test cases)
•TestCases that demonstrate robust behavior in the presence of invalid inputs (negative test cases)
•TestCases that demonstrate robust behavior under stress (stability test cases)
•Any grouping of TestCases that has some kind of meaning to the user, such as, feature testing, component testing, and safety testing.
A Scenario can be executed by the test tool. TestCases are only run in the context of a running Scenario. (Note that even when a single TestCase is run stand-alone, it is run in the context of an unseen Default Scenario.) If any included TestCase fails, then the Scenario is marked as failed. Details of Scenario and TestCase pass/fail outcomes are reported on completion of the Scenario or a Regression test run.
Consider the example below:
|
Precondition |
TestCase (Or Behavior Spec) |
|
|
Initial State |
Causal Action |
Effect |
Job1 |
Powered Off |
Depress Power Switch |
State changes to Powered On |
Job2 |
Powered On/Disarmed |
Close all doors and windows |
State changes to Arming |
Job3 |
Arming |
Wait 30 seconds |
State changes to SecurityArmed |
Job4 |
Armed |
Open Hood |
Alarm Sounds |
This defines the more complex behavior of how the alarm sounds, if the security system is armed and the hood is opened. A Scenario is just a way to define a sequence of TestCases to create a more complex test.
The MxSuite provides two ways to define Scenarios: Predefined and Reactive. It is possible to mix reactive and nonreactive TestCases in the same Scenario.
In a predefined Scenario, the execution sequence of TestCases (jobs) is defined in the MxVDev GUI as shown here: Advantages: •This is the fastest and simplest method. •No coding is needed. •The execution sequence is more predictable. Disadvantages: •There is less flexibility. •You cannot change Configuration Sets. |
In a reactive Scenario, the execution sequence of TestCases (jobs) are defined by C# code. Advantages: •Provides maximum flexibility. •Supports loading and reloading Configuration Sets. •Supports conditional behavior. For example: If Scenario A passes, execute Scenario B, else execute Scenario C. •Schedule execution of jobs based on the value of any Signal or on the Pass/Fail status of the Scenario, any TestCase, or any Signal. Disadvantages: •Requires some knowledge of C# code. •The test may be harder to understand. |