Validate Migrated Model
After migrating the signal-based model to a service-oriented architecture, validate that the migrated model functionality matches the original model functionality using the input data and test cases you created in the first step, Generate Baseline Tests.
Create a test harness for the migrated model from the top-level of the model.
For this example, a test harness was created from the
VCUSoftware.slx
model using the Schedule Editor to add a scheduler for function-calls and rates and a Signal Editor block to provide the test scenario input values.Note
The Schedule Editor allows you to easily view and edit the schedule of the function calls. For more information, see Schedule Editor.
To open the test harness, run this command.
open("VCUSoftware_Harness2.slx");
In the Signal Editor block, specify File name using the same file that was used to validate the signal-based model.
For this example, File name is specified as
VCUInputs.mat
, which was the file you used in Generate Baseline Tests.Use the test cases and baseline criteria developed for validating the signal-based model in a new Simulink test file.
In this example, a tolerance was added to the test cases to account for slight variations in timing between the signal-based model test harness and the service-oriented architecture model test harness created with Schedule Editor.
To view the test cases, run this command.
open("EV2MVCUMiLtestsNew.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;