Component Tests in Project
Metric ID
project.mt.ComponentTests
Description
You can use this metric to count the number of component tests in the project. Component tests evaluate the component design, or a part of the design, in the same execution context of the component. These tests help you assess the quality of the component.
The Project Model Testing dashboard uses the results from this metric in the Test Status section, in the Component Tests widget.
Supported Artifacts
You can collect this metric for the Units in your project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.
Computation Details
The metric:
Aggregates the Component Tests metric results from the components in the project.
Only includes tests that directly contribute to the quality of component testing. Specifically, tests on:
Component models
Atomic subsystems
Atomic subsystem references
Atomic Stateflow® charts
Atomic MATLAB® Function blocks
Referenced models
Excludes tests on:
Libraries
Subsystem references
Virtual subsystems
Collection
To collect data for this metric, execute the metric engine and use getMetrics
with the metric ID
project.mt.ComponentTests
.
metric_engine = metric.Engine; execute(metric_engine,"project.mt.ComponentTests"); results = getMetrics(metric_engine,"project.mt.ComponentTests")
Collecting data for this metric loads the model file and test result files and requires a Simulink® Test™ license.
Results
For this metric, instances of metric.Result
return these properties.
Value
— A structure that contains:Count
— Number of component tests in the project
Artifacts
— An array of structures, with one structure for each component test. The structures contain theUUID
,Name
,ParentUUID
, andParentName
values for that component test.
Compliance Thresholds
The default compliance thresholds for this metric are:
Compliant
—0
tests are missing links to requirementsNon-Compliant
—1
or more tests are missing links to requirementsWarning
— None
See Also
Project Model Testing Metrics | Summary of Model Testing Statuses for Project | Tests in Project | Tests with Requirements in Project