Generate Baseline Tests
Before partitioning the software application into separate services, generate a set of test cases with baseline criteria to verify the signal-based model functions as expected. You will run these baseline tests again on the migrated model in a later step. This example uses Simulink® Test™ to generate and run baseline tests. For more information, see Baseline Testing (Simulink Test).
Create a test harness for the signal-based model from the top-level of the model.
For this example, a test harness was created from the
VCU_Software.slx
model, with a Signal Editor block providing the test scenario input values.To open the test harness, run this command.
open_system("VCU_Software_Harness1.slx");
Save test scenario input values to a file and select the file in the Signal Editor block.
For this example, the input values are saved to the
VCUInputs.mat
file.Set up test cases with baseline criteria defined.
For this example, the test cases created validate normal and sport drive modes. The baseline criteria values are saved to these mat files:
FullVCUNormalMode.mat
FullVCUSportMode.mat
To view the test cases for this example, run this command.
open("BaselineMILTests.mldatx");
Run the test cases and compare the results against the baseline criteria.
For this example, run the
VCU_2EMEV_Harness_Baseline
test case and compare the baseline results with the simulation output. Repeat this step with theVCU_2EMEV_Harness_HighRegen
test case.To run the test cases and view the results, run these commands.
sltest.testmanager.run; sltest.testmanager.view;
After verifying the signal-based model functions as expected, partition the software application into separate services.
See Also
Topics
- Test Authoring (Simulink Test)
- Create a Test Harness (Simulink Test)
- Simulink Test Manager (Simulink Test)