输入
基于步骤的测试序列,外部数据源,信号编写,自动测试用例生成
您可以通过将外部数据映射到您的测试用例,编写输入数据或使用 Simulink® Design Verifier™ 自动生成输入来开发测试场景:
根据您的模型创建模板 MAT 文件或 Excel® 文件,然后添加值。
直接根据 Excel 文件中包含的数据创建测试。有关详细信息,请参阅Use External File Data in Test Cases。
将 MAT 文件或 Excel 文件映射到在测系统。
在 Simulink Design Verifier 中生成测试输入,以扩大覆盖率或复制设计错误条件。将生成的测试添加到测试文件中。
将 Signal Editor 模块放入在测系统中,然后以图形方式编写输入。
您还可以使用 Test Sequence 模块编写对仿真行为进行响应的测试输入。使用 Test Sequence 模块,可通过将 MATLAB® 用作动作语言来定义步骤和转移集。您还可以在层次结构中使用顺序步骤组或切换步骤组,并在 Test Sequence 模块中创建测试序列。
模块
Test Sequence | Create simulation testing scenarios, function calls, and assessments |
工具
测试管理器 | Model and code testing in different execution environments, manage test suites, and analyze and report results |
主题
使用外部数据
- Create External Data Files to Use in Test Cases
Create Excel, MAT, and MATLAB script (.m
) files for test data input. - Use External File Data in Test Cases
Add test data from Excel files, MAT-files, and MATLAB script (.m
files) to test cases.
生成测试输入
- Increase Coverage by Generating Test Inputs
Use Simulink Design Verifier to generate tests that extend coverage and recreate design errors, and add generated tests to your test file. - Generate Test Signals
Generate signal inputs to the component under test.
响应仿真
- Test Sequence Basics
Overview of test sequence actions, transitions, and hierarchy. - Test Sequence Editor
How to use test steps, transitions, data, andWhen
decomposition sequences in Test Sequence and Test Assessment blocks. - Test Sequence and Assessment Syntax
Operators and expressions used in Test Sequence and Test Assessment blocks and Stateflow® charts. - Transitions, Temporal Operators, and Messages in Test Sequence Blocks
Transition between test sequence steps using conditional logic, temporal operators, and messages. - Using an External Function in a Test Sequence Block
Call externally-defined function from Test Sequence block.