Perform Back-to-Back (MIL/SIL) Equivalence Test for an Atomic Subsystem
This example shows how to create and run a back-to-back test, which is also known as an equivalence test, for an atomic subsystem.
Generate Code for the Model
Generate code for the entire model.
model = 'sltestMILSILEquivalence'; open_system(model); % Configure for code generation if ismac lProdHWDeviceType = 'Intel->x86-64 (Mac OS X)'; elseif isunix lProdHWDeviceType = 'Intel->x86-64 (Linux 64)'; else lProdHWDeviceType = 'Intel->x86-64 (Windows64)'; end set_param(model, 'ProdHWDeviceType', lProdHWDeviceType); slbuild(model);
### Starting build procedure for: sltestMILSILEquivalence ### Successful completion of build procedure for: sltestMILSILEquivalence Build Summary Top model targets built: Model Action Rebuild Reason ========================================================================================================= sltestMILSILEquivalence Code generated and compiled. Code generation information file does not exist. 1 of 1 models built (0 models already up to date) Build duration: 0h 0m 18.881s
Create a Back-to-Back Test with the Test For Model Component Wizard
1. Create a new test file and open the Test Manager.
tFile = sltest.testmanager.TestFile('sltestMILSILEquivalence_tests.mldatx'); sltest.testmanager.view();
2. Enable coverage collection for the test file. in the Coverage Settings section of the Test Manager, enable Record coverage for system under test under Coverage to Collect and select Decision and MCDC under Coverage Metrics.
3. Right-click the test file and select New > Test For Model Component.
4. Click the Use current model icon to add the Top Model. Select Controller and click the plus sign. Then click Next.
5. Select Use Design Verifier to generate test input scenarios. Then click Next.
6. Select Perform back-to-back testing. Check that Simulation1 is set to
Normal and Simulation2 is set to
Software-in-the-Loop (SIL). Then click Next.
7. Click Done on the Generated Test page. The back-to-back (equivalence) test is created.
Run the Test and View the Results
Select sltestMILSILEquivalence_Harness1. Then click the arrow below Run and select
Run Selected Tests.
When the test completes, select Results and view the Summary and Aggregated Coverage Results sections.