Verify and Validate Requirements
Using Simulink® Test™ and Requirements Toolbox™, you can verify requirements by linking to test cases. For more information, see Link Test Cases to Requirements (Requirements Toolbox).
You can author an architecture model in System Composer™ and then link requirements to model elements that satisfy those requirements. For more information, see Allocate and Trace Requirements from Design to Verification.
Use Test Harnesses to Verify System Design
A test harness is a model that isolates the component under test with inputs, outputs, and verification blocks configured for testing scenarios. You can create a test harness for a model component or for a full model. A test harness gives you a separate testing environment for a model or a model component.
A Simulink Test license is required to use the Simulink Test Manager (Simulink Test) and to create test harnesses for components. For more information, see Create a Test Harness (Simulink Test).
Create a test harness for a System Composer component to validate simulation results and verify design. To edit the interfaces while you are testing the behavior of a component in a test harness, use the Interface Editor.
Use Simulink Test to perform requirement-based testing workflows that include inputs, expected outputs, and acceptance criteria. For more information on using Simulink Test with Requirements Toolbox, see Link Test Cases to Requirements (Requirements Toolbox). Test harnesses are not supported for Adapter blocks in architecture models or for Component blocks that contain a Reference Component in software architecture models.
Create Test Harness for Airframe
Component
This example uses the architecture model for an unmanned aerial vehicle (UAV) to create a test harness for a System Composer component. In the MATLAB® Command Window, enter this command.
scExampleSmallUAV
To create a test harness for the Airframe
component:
Right-click the component.
Select Test Harness > Create for 'Airframe'.
In the Create Test Harness dialog box, specify the name of your test harness and click OK.
Your test harness opens in a new window, and the Harness menu is available in the toolstrip.
Tip
If the model component is in an early step in the design process and not fully wired, then in the Create Test Harness dialog box, you can select the Advanced Properties tab and select Create without compiling the model.
Use the Simulink Test Manager (Simulink Test) with the test harness to create test files and test cases. For more information, see Test Harness and Model Relationship (Simulink Test) and Create or Import Test Harnesses and Select Properties (Simulink Test).
Combine Subsystems for Integration Testing
To test whether combined systems as a whole function as designed, you can create test harnesses around progressively larger systems or subsystems. Once these subsystems are connected, use a testing framework to confirm that requirements are satisfied.
See Also
Tools
- Requirements Editor (Requirements Toolbox) | Requirements Manager (Requirements Toolbox) | Simulink Test Manager (Simulink Test)
Related Topics
- Redirect Reference Requirement Links from Imported File
- Allocate and Trace Requirements from Design to Verification
- Establish Traceability Between Architectures and Requirements
- Organize System Composer Files in Projects
- Validate Requirements for Machine Cooling System Architecture
- Design Insulin Infusion Pump Using Model-Based Systems Engineering