Test harness
Creare un ambiente di simulazione specifico per il test del modello utilizzando un test harness. È possibile isolare singoli blocchi per eseguire test unitari e aggiungere input, logiche di verifica e blocchi dashboard. Eseguire test a loop chiuso aggiungendo modelli d'impianto fisico al test harness. Testare le potenziali modifiche di progettazione nel test harness prima di modificare il modello di produzione.
Rispetto all'utilizzo di modelli separati per i test unitari, i test harness offrono funzionalità di gestione e sincronizzazione nell'area di disegno del modello. Se il modello è sottoposto a gestione delle modifiche, è possibile salvare i test harness in file esterni, senza modificare il modello principale.
È possibile testare il codice generato simulando test harness in modalità SIL o PIL. È inoltre possibile testare il codice esterno scritto manualmente creando test harness per i blocchi C Caller o S-Function.
Strumenti
| Simulink Test Manager | Testing models and code in different execution environments, manage test suites, and analyze and report results |
Argomenti
- Test Harness and Model Relationship
Test a Simulink® model in an isolated environment, using a separate workspace and configuration set accessed via the model canvas.
- Creazione di un test harness
Utilizzare un test harness per isolare il componente sottoposto a test.
- Create or Import Test Harnesses and Select Properties
Create, import, and customize test harness configurations for your model and subsystem.
- Manage Test Harnesses
Manage test harnesses, including opening, converting, closing, deleting, and exporting.
- Synchronize Changes Between Test Harness and Model
Transfer configuration sets and workspace variables, update component design, and rebuild harness to reflect the latest design.
- Test Harness Construction for Specific Model Elements
Describes how test harnesses are constructed for certain Simulink semantics and component types.
- Test Library Blocks
Test reusable components using tests for libraries, library blocks, and linked blocks.
- Customize Test Harnesses
Create reusable functions and callbacks that customize test harnesses.
- Create Test Harnesses from Standalone Models
Import standalone models as test harnesses in Simulink Test™.
- Use Stateflow Chart for Test Harness Inputs and Scheduling
Use Stateflow Chart to define test harness inputs and test sequence.