主要内容

Test Status Comparison Distribution for SIL Mode

R2026b
Since R2026b

Metric ID

modeltesting.sil.TestResultAnalysis[slcomp.TestStatusComparisonDistribution]

Description

This metric returns the distribution of test status comparisons between model simulation and software-in-the-loop (SIL) code execution for each unit. The metric compares the pass or fail status of each test in both execution modes.

Use this metric to identify tests that pass in one mode but fail in the other, which can indicate translation issues between the model and the generated code.

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.sil.TestResultAnalysis[slcomp.TestStatusComparisonDistribution]")

View the metric result values.

results(1).Value

To collect all metrics in the modeltesting.sil.TestResultAnalysis group at once, use the group name with empty brackets.

results = execute(metric_engine,"modeltesting.sil.TestResultAnalysis[]")
Use the MetricID property to distinguish results from different metrics in the group.

Results

The metric returns a metric.Result object for each unit in the project.

The Value property returns a structure with these fields:

  • Total — Total number of tests for the unit.

  • FailedInModelAndCode — Number of tests that failed in both model simulation and SIL code execution.

  • FailedInModelOnly — Number of tests that failed in model simulation but passed in SIL code execution.

  • FailedInCodeOnly — Number of tests that failed in SIL code execution but passed in model simulation.

  • PassedInModelAndCode — Number of tests that passed in both model simulation and SIL code execution.

  • Incomplete — Number of tests that do not have results in both modes.

See Also

Objects

Functions

Topics