Simulink Verification and Validation
Simulink Verification and Validation provides an API for the analysis and simulation of one or more referenced models, subsystems, or atomic subcharts in a model. All component testing functions can be used from the command line or incorporated into MATLAB® scripts.
The harness model generation function lets you isolate an atomic subsystem or a model referenced by a larger control system model and extract it into a harness model for additional testing and analysis. You can use the harness model for exhaustive testing of components that are being developed, or when the rest of the system model may not be available for simulation.
The harness model generation function automates interface configuration for the root-level inputs and outputs including complex deeply nested buses. Subsystem dependencies, such as external data stores, are integrated in the harness and associated with the new model inputs. All required signal labeling and connections are automated to match the attributes of the component under test.
Create a Test Harness and Import Test Cases
Create a test harness to verify model behavior. Import existing functional tests and set up harness for analysis using Simulink Verification and Validation™.
With the data logging function you can capture input signals during closed-loop simulation and reuse the logged test vectors for simulation of the harness model. Because the underlying data format is compatible with Simulink Design Verifier™, you can use the test-generation capability provided in Simulink Design Verifier to generate additional test cases.
When generating the harness model, the model harness generation function can include the logged data and import it in the Signal Builder block for editing.
Harness models that include a Signal Builder block can be used for debugging and detailed analysis. The Simulink Signal Builder block lets you graphically edit test vectors and import existing test data from document spreadsheets.
With the test execution function you can automate execution of test cases against models and generated code in simulation, SIL, and PIL modes. The SIL and PIL modes require Embedded Coder.
Component test results can be imported into the Data Inspector for further analysis. The test execution function integrates with model coverage and code coverage tools to collect additional information about test completeness.
Simulate Test Cases and Measure Model Coverage
Execute functional test cases to test your design components using Simulink Verification and Validation™.
You can link the test cases in Signal Builder to external documents, such as functional requirements and test plans, via the Requirements pane in the Signal Builder window. In addition, you can assign assertions to individual test cases to automatically analyze pass/fail results.