In scenario-based testing, the test author configures the input data to “move” the system through a set of desired states or maneuvers. A simple example of this would be a “wide-open throttle” scenario for automobiles
- Key set to crank
- Hold .1 second
- Key set to run
- Together
- Brake to 100%
- PRNDL to Drive
- Together
- Brake to 0%
- Throttle to 100%
Measure time to 60 MPH
Reusing scenarios
In scenario-based testing, there are often common “starting points”. In our example above the common starting point would be the first 3 steps. In the example that follows, using a Test Sequence block I implemented the common steps as a single, grouped, step.
When the common setup is complete the sequence block then moves onto another “grouped” step which implements the specific test. Optionally a second or third “common setup” sequence could be defined before the actual test begins.
Chained data
Another
Why perform scenario-based testing?
Scenario-based testing allows us to validate that models behave in the way we expect and the way we designed, if I “put the pedal to the metal” the car accelerates quickly. Most frequently I use them to
- Validation of state machine behavior
- Exercising diagnostic code
- Validate requirements
- Debug models under development

