Baseline Testing
This tutorial shows how to use Simulink® Test™ to create and run a baseline test to test for regression after you make changes to a model.
When you run a baseline test case, you compare simulation output data to baseline data. To run a baseline test using Simulink Test, you create a baseline test case and set test properties. You can use the Test Manager to capture logged signal data from the system under test or add baseline data from an existing file and set signal tolerances to specify the pass/fail criteria for the test. After you make changes to a model, you can run the baseline test case to simulate the model and check whether the new simulation output data satisfies the pass/fail criteria.
In this tutorial, you follow these steps to create a test case, capture baseline data, run the test and create a results report:
Author a Baseline Test Case: Create a new test file, specify test properties in the Test Manager, and capture and validate baseline data for the test.
Compare Simulation to Baseline Data: Make changes to the model, run the test case, and review results.
Create a Test Results Report: Use the Test Manager to generate a test results report.
Examine the Model
This tutorial uses the sldemo_absbrake
model. To open the model, enter:
open_system("sldemo_absbrake");
The sldemo_absbrake
model simulates the behavior of a wheel with an Anti-Lock Braking System (ABS) and logs the signals in the MATLAB workspace. To simulate the model, on the Simulation tab, click Run. The plots display the vehicle and wheel speed, slip, and wheel acceleration while braking. For more information on the model physics and analysis, see Model an Anti-Lock Braking System.