Independent Tests
R2026bMetric ID
modeltesting.TestAnalysis[slcomp.IndependentTests]
Description
This metric returns the number of independent tests for the unit. Independent tests can execute independently of the component and can behave differently depending on the conditions specified in the test harness. Therefore, these tests do not definitively indicate the quality of component testing. These include tests on libraries, subsystem references, and virtual subsystems.
Use this metric to count the number of tests for the component design, or a part of the design, in a different execution context than the component itself.
Supported Artifacts
This metric collects metric results for Units in the project. To control what the dashboard classifies as a unit, see Categorize Models in Hierarchy as Components or Units.
Collection
To collect data for this metric, execute the metric engine with the metric ID.
metric_engine = metric.Engine;
results = execute(metric_engine,"modeltesting.TestAnalysis[slcomp.IndependentTests]")View the metric result values for a specific unit.
results(1).Value results(1).ScopeAlias
To collect all metrics in the modeltesting.TestAnalysis group at once,
use the group name with empty
brackets. Use the MetricID property to distinguish results from different
metrics in the
group.
results = execute(metric_engine,"modeltesting.TestAnalysis[]")Results
The metric returns an array of objects, one for each unit in the project.
Use the metric.ResultValue property of the metric result object to view the metric
result values. Use the ScopeId and ScopeAlias
properties to identify which unit the result belongs to.
The ScopeAlias property returns the name of the unit.
The Value property returns a structure with these
fields:
Count— Number of independent tests for the unit.