Main Content

metric.threshold.ThresholdOutcome

R2026b

Classification outcome of metric result against threshold rule

Since R2026b

    Description

    A metric.threshold.ThresholdOutcome object captures the classification category of a metric result with traceability to the threshold rule and threshold set that produced the classification. When you collect metrics with a threshold set, each metric.Result object contains threshold outcomes. These outcomes indicate the compliance category of the result according to the threshold rules in that set.

    For more information about thresholds and custom threshold sets, see Adjust Dashboard Thresholds to Match Your Testing Criteria.

    Creation

    You do not create metric.threshold.ThresholdOutcome objects directly. Instead, access threshold outcome objects from the ThresholdOutcomes property of a metric.Result object. Threshold outcomes are populated when you call getMetrics with the ThresholdSetId name-value argument.

    Properties

    expand all

    This property is read-only.

    Compliance category assigned to the metric result by the threshold rule, returned as one of these values:

    • Compliant — The metric result meets the threshold criteria.

    • NonCompliant — The metric result does not meet the threshold criteria.

    • Warning — The metric result is in a warning range and may require attention.

    • Uncategorized — The metric result does not match any defined classification criteria.

    This property is read-only.

    Identifier of the threshold rule that produced this classification outcome, returned as a string scalar. Use this identifier to trace the outcome back to the specific threshold rule definition.

    Example: "RatioPassed"

    This property is read-only.

    Identifier of the threshold set that contains the threshold rule, returned as a string scalar.

    Example: "ReqBasedTesting"

    This property is read-only.

    Diagnostic messages generated during threshold evaluation, returned as a structure array with the fields:

    • Severity — Severity level of the diagnostic

    • Identifier — Identifier of the diagnostic

    • Message — Descriptive message text

    An empty structure array indicates that the evaluation did not generate diagnostics.

    Examples

    collapse all

    Collect metric results with a threshold set and inspect the classification outcomes.

    Create a metric engine for the project and collect metric results using the "ReqBasedTesting" threshold set.

    eng = metric.Engine();
    execute(eng);
    res = getMetrics(eng, ...
        "modeltesting.TestResultAnalysis[slcomp.TestStatusDistribution]", ...
        ThresholdSetId="ReqBasedTesting")
    res =
    
      1x5 Result array with properties:
    
        UserData
        Value
        MetricID
        Artifacts
        ScopeId
        ScopeAlias
        ThresholdOutcomes
        Diagnostics

    Inspect the threshold outcomes for one of the results.

    res(1).ThresholdOutcomes
    ans =
    
      1x5 ThresholdOutcome array with properties:
    
        ClassificationCategory
        ThresholdRuleId
        ThresholdSetId
        Diagnostics

    Examine a specific threshold outcome to see the classification category and which threshold rule produced it.

    res(1).ThresholdOutcomes(4)
    ans =
    
      ThresholdOutcome with properties:
    
        ClassificationCategory: NonCompliant
              ThresholdRuleId: "RatioPassed"
               ThresholdSetId: "ReqBasedTesting"
                  Diagnostics: [0x1 struct]

    Version History

    Introduced in R2026b