Model-Based Testing
Introduction
AF3 integrates a model-based testing framework with the following features:
- Generate test suites from models with the given coverage criteria or input profiles
- Simulate the model by using a test case as input.
- Update the test suite if the model is changed.
Generate Test Suites
- Step 1 - Right click a component in the model navigator and select "Test Suite Specification"
- Step 2 - Set the random parameters in the editor.
- Step 3 - Right click on the test suite specification and select "Generate Test Suite".
- Step 4 - The generated test suites will be listed under the component.
- Step 1 - Right click a test suite and select Run TestSuite.
- Step 2 - AF3 will switch to simulation perspective and the model and test case will be shown in the views.
- Step 3 - Click "Simulated Step" button in the simulation view to jump to the next step. The green arrow in the Test Case View marks the current position in the whole test case.
- Step 4 - If all test steps in the test case are simulated, the simulator will jump back to the first step.
Test statistics
For test suites of components with automaton specifications you can find statistical information on the states and transitions
visited
if you open the test suite and select the "Statistic" tab:
Update Test Suite
- Step 1 - Select a test suite in the model navigator.
- Step 2 - Right click on the test suite and select "Update Test Suite".
- Step 3 - A new test suite will be created by AF3 with the same inputs and re-computed outputs.
Edit TestSuite
- Step 1 - Open a test suite.
- Step 2 - Right click on the test case or test step, a context menu with inserting, deleting test case or test step will shown.
- Step 3 - Click a cell in the test suite editor, the cell will be activated and the value can be modified.
Record TestSuite
- Step 1 - Start a model in the simulator view.
- Step 2 - Click the quick access box, search Simulation Trace Tree and open the view.
- Step 3 - Click the record button on the trace view and simulate the model.
Step 3 - Click the save button to save the recored test suite into component.
Step 4 - A new test suite with the name "Trace Result" can be found.