Main Content

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).

  1. 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");

    VCU Software model test harness

  2. 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.

    Signal Editor Block Parameters dialog box

  3. 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

    Simulink Test browser test case list.

    To view the test cases for this example, run this command.

    open("BaselineMILTests.mldatx");

  4. 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 the VCU_2EMEV_Harness_HighRegen test case.

    Results and Artifacts tree

    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