Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

收集模型和测试指标

收集模型指标数据并创建自定义模型指标

您可以使用模型指标来评估模型和代码是否符合大小、复杂度和可读性要求。当您根据需求测试模型时,可以使用指标来评估基于需求的测试活动的状态和质量。您可以使用模型指标 API 来创建自己的模型指标、计算模型和测试指标并导出指标数据。要可视化模型的指标数据和合规性状态,请使用指标仪表板。使用模型测试仪表板查看关于模型需求完整性、测试用例和测试结果的指标数据。要快速入门,请参阅使用 Metrics Dashboard 收集和探查指标数据Explore Status and Quality of Testing Activities Using the Model Testing Dashboard

全部展开

slmetric.EngineCollect metric data on models or model components
slmetric.metric.MetaInformation Set metadata for custom metrics
slmetric.metric.ResultMetric data for specified model component and metric algorithm
slmetric.metric.ResultCollectionMetric data for specified model metric
slmetric.metric.ResultDetail Details about instances of slmetric.metric.Result objects
slmetric.metric.ResultClassification Access metric data thresholds results
slmetric.config.Configuration Specify metric data categories and custom metric families
slmetric.config.ThresholdConfiguration Specify metric and slmetric.metric.Result property for thresholding
slmetric.config.Threshold Object for holding metric result thresholds
slmetric.config.ClassificationSpecify categorical metric data ranges
slmetric.config.MetricRangeSpecify metric data threshold values
slmetric.dashboard.ConfigurationObject containing information on Metrics Dashboard layout and widgets
slmetric.dashboard.Container Widget for holding slmetric.dashboard.Widget and slmetric.dashboard.CustomWidget objects in Metrics Dashboard
slmetric.dashboard.CustomWidgetObject for holding custom Metrics Dashboard widgets
slmetric.dashboard.Group Widget for holding slmetric.dashboard.Container, slmetric.dashboard.Widget and slmetric.dashboard.CustomWidget objects on Metrics Dashboard
slmetric.dashboard.Layout Create object for holding Metrics Dashboard customizations
slmetric.dashboard.WidgetObject for holding Actual/Potential Reuse, System Interface, or System Info widgets
Advisor.component.ComponentCreate component for metric analysis
Advisor.component.TypesCreate enum class specifying component type
slmetric.metric.MetricAbstract class for creating model metrics
metric.EngineCollect metric data on model testing artifacts
metric.ResultMetric data for specified metric algorithm and requirements-based testing artifacts

函数

全部展开

metricsdashboardOpen Metrics Dashboard
slmetric.metric.getAvailableMetricsObtain available metrics
slmetric.config.getActiveConfigurationObtain file path and name of XML file containing active Metrics Dashboard custom configuration
slmetric.config.setActiveConfigurationActivate custom configuration for metric engine to use
slmetric.dashboard.setActiveConfigurationActivate custom metric dashboard layout
slmetric.dashboard.getActiveConfigurationObtain file path and name of XML file containing active Metrics Dashboard layout
slmetric.metric.createNewMetricClassCreate new metric class for a custom model metric
slmetric.metric.registerMetricRegister a custom model metric with the model metric repository
slmetric.metric.unregisterMetricUnregister a custom model metric from the model metric repository
slmetric.metric.refreshUpdate available model metrics
modelTestingDashboardOpen Model Testing Dashboard

主题

模型指标

使用 Metrics Dashboard 收集和探查指标数据

收集和查看用于质量评估的指标数据。

Customize Metrics Dashboard Layout and Functionality

Configure compliance metrics, add metric thresholds, and customize Metrics Dashboard layout.

Collect Model Metrics Programmatically

Use the model metric API to programmatically collect metrics for a model, such as subsystem and block counts.

Model Metrics

Model metrics provided by MathWorks that return metric data on your model for size, complexity, readability, and compliance to standards and guidelines.

Model Metric Data Aggregation

Options for defining model metric data aggregation and returning aggregated model metric results.

Create a Custom Model Metric for Nonvirtual Block Count

Create a new model metric by using the slmetric.metric.createNewMetricClass function and defining the metric algorithm.

Identify Modeling Clones with the Metrics Dashboard

You can use the Model Metrics Dashboard tool to enable subsystem reuse by identifying exact graphical clones across a model hierarchy.

Collect Model Metrics Using the Model Advisor

Assess model size, complexity, and readability, using the Model Advisor to run model metric checks.

Collect Compliance Data and Explore Results in the Model Advisor

This example shows how to collect model metric data by using the Metrics Dashboard and explore detailed compliance results and, fix compliance issues by using the Model Advisor.

Collect Metric Data Programmatically and View Data Through the Metrics Dashboard

This example shows how to use the model metrics API to collect model metric data for your model, and then explore the results by using the Metrics Dashboard.

Fix Metric Threshold Violations in a Continuous Integration Systems Workflow

Use a continuous integration workflow to investigate whether your model violates metric threshold values.

Compare Model Complexity and Code Complexity Metrics

Assess the complexity of your system in model-based design.

基于需求的测试指标

Explore Status and Quality of Testing Activities Using the Model Testing Dashboard

Evaluate the status and quality of model testing in your project.

Fix Requirements-Based Testing Issues

Fix model testing quality issues by using the Model Testing Dashboard.

Model Testing Metrics

Model testing metrics provided by MathWorks that return metric data on your model for implementing and testing requirements.

Manage Requirements-Based Testing Artifacts for Analysis in the Model Testing Dashboard

Set up and manage a project that uses the Model Testing Dashboard.

Collect Metrics on Model Testing Artifacts Programmatically

Use a script to assess the quality of your requirements-based testing.

Assess the Completeness of Requirements-Based Testing in Accordance with ISO 26262

Use the Model Testing Dashboard to analyze the completeness and quality of requirements-based testing activities in accordance the ISO 26262 standard.