Main Content
Generate Tests
Generate sets of tests to satisfy model and code coverage and custom
testing criteria
Test generation produces sequences of input values for your models to satisfy testing criteria, such as model coverage. Simulink® Design Verifier™ extends existing model coverage information from requirements-based tests. It generates additional sequences of test inputs that meet the coverage objectives not satisfied during requirements-based testing. Use these test inputs to better understand missing requirements and to create a more complete test harness.
Blocks
Functions
Topics
Start Here
- What Is Test Case Generation?
Brief overview of test case generation with Simulink Design Verifier. - Workflow for Test Case Generation
Outlines a process for generating test cases for your model. - When to Extend Existing Test Cases
Explains when to extend existing test cases to create a complete test suite. - Creating and Executing Test Cases
This example shows how to use Simulink® Design Verifier™ functions to log input signals, create a harness model, generate test cases for missing coverage, merge harness models, and execute test cases. - Export Test Cases to Simulink Test
Describes how to generate test cases in Simulink Test™ using Simulink Design Verifier analysis results, which can be generated by property proving, design error detection, and test case generation. - Generate and Export Tests from Requirements Table Blocks
Automate test generation and execution in models that contain Requirements Table blocks. - Defining and Extending Existing Tests Cases
This example shows how Simulink® Design Verifier™ can extend test cases with additional time steps to efficiently generate complete test suites. - Use Test Generation Advisor to Identify Analyzable Components
Use the Test Generation Advisor to guide model and component analysis. - Extend Existing Test Cases by Reusing Model Representation
Reanalyze a model by reusing the model representation. - Basic Workflow for Enhanced MCDC Analysis
Workflow to generate test cases for enhanced Modified Condition Decision Coverage (MCDC) coverage objectives.
Generate Tests for Model Decision Coverage
- Model Coverage Objectives for Test Generation
Test cases are generated to drive your model to satisfy condition, decision, modified condition/decision (MCDC), and custom coverage objectives. - Generate Test Cases for Model Decision Coverage
An example that walks you through the process of generating the test cases for a model. - Specify Parameter Configuration for Full Coverage
An example of how to specify parameter constraint values to achieve full model coverage. - Generate Test Cases for a Subsystem
Analyze an individual subsystem. - Generate Test Cases for a Reusable Library Subsystem
Analyze a reusable library subsystem. - Extend Test Cases for Model with Temporal Logic
Extends existing test cases to analyze a model that uses temporal logic. - Extend Test Cases for Closed-Loop System
Extends existing test cases to analyze a closed-loop system in a model. - Extend Test Cases for Modified Model
Extends existing test cases for a model that you have previously analyzed and then modified. - Extend an Existing Test Suite
This example shows how to use Simulink® Design Verifier™ to extend an existing test suite to obtain missing model coverage. - Extend Existing Test Cases After Applying Parameter Configurations
This example shows how to achieve missing coverage by extending existing test cases after applying parameter configurations. - Enhance Model Coverage of Older Release Models
Explains how to use cross release workflow for model upgrade by using Simulink Design Verifier.
Generate Tests for Custom Code in a Model
- Configuring S-Function for Test Case Generation
This example shows how to compile an S-Function to be compatible with Simulink® Design Verifier™ for test case generation. - Test Generation on Model with C Caller Block
Test generation on a model with a C Caller block and custom C code. - Test Generation for Custom Code in MATLAB Function Block
Simulink Design Verifier analysis supports models that call custom code from MATLAB® function blocks by usingcoder.ceval
. - Support Limitations and Considerations for S-Functions and C/C++ Code
Describes limitations and considerations of S-functions and Generated Code in Simulink Design Verifier. - Author Custom Test Objective Workflow
Describes the workflow for authoring custom test objectives. - Test Generation for Custom Code in a Stateflow Chart
Test generation on a model with custom code in a Stateflow chart.
Generate Tests for Analyzable Model Components
- Generate Test Cases for Model Blocks
Generate Test Cases for Model Reference blocks. - Use Test Generation Advisor to Identify Analyzable Components
Use the Test Generation Advisor to guide model and component analysis. - Generate Tests for Model Block Component by Using Default Simulation
This example shows how to use Simulink® Design Verifier™ to generate test cases for a Model block by using a default top model simulation. - Achieve Missing Coverage in Subsystems and Model Blocks
Explains how to convert subsystems to Model blocks before attempting to achieve missing coverage. - Achieve Missing Coverage in Referenced Model
Achieves missing coverage data in a referenced model and combines it with coverage data for the top-level model. - Achieve Missing Coverage in Closed-Loop Simulation Model
Achieves missing coverage data in a closed-loop simulation model. - Analyze Coverage for Lookup Table Boundary Values
Describes how to generate tests for lookup table boundary value coverage. - Using Existing Coverage Data During Subsystem Analysis
This example shows how Simulink® Design Verifier™ can target its analysis to a single subsystem within a continuous-time closed-loop simulation and generate test cases for missing coverage in that subsystem. - Achieve Coverage in Models with Variable-Size Inputs
This example shows you how to achieve model coverage in models with variable-size input signals by using Simulink Design Verifier™. - Achieve Missing Coverage in Generated Code of RLS
This example shows you how to use Simulink® Design Verifier™ to generate test cases that achieve full coverage. - Achieve Missing Coverage in Custom Code
This example shows you how to test for missing coverage in custom code. - Inspect Test Generation Objectives by Using Model Slicer
Inspect Test Generation Objectives using Model Slicer.
Generate Tests to Complete Coverage of Generated Code
- Code Coverage Test Generation
This example shows how to use Simulink® Design Verifier™ to generate test cases to obtain complete code coverage. - Generate Test Cases for Embedded Coder Generated Code
Outlines a process for generating test cases for generated code.