Realistic Measurement of Model Size

Do You Want to Assess Your Model's Architecture?

本文章目前仅提供英文版本。

Ensuring a well-structured model architecture is essential for developing safe and reliable software. In this article, we explore how the MES Model Examiner® (MXAM) enhances model architecture, simplifies complexity management, and ultimately improves software quality.

ISO 26262-Compliant Analyses and Visualization of Model Architecture

A sound model architecture is a vital prerequisite for safe software that is generated from these models. MXAM helps you analyze the architecture of Simulink, Stateflow, Embedded Coder, and TargetLink models. The analysis provides you all relevant software metrics to realistically evaluate the architecture, complexity, and size of your models. MXAM’s fast and precise structure and complexity analysis gives you complete transparency of your models and helps to improve the generated code.

How MXAM Can Reduce Model Complexity and Improve Generated Code

本图描述了利用工件导航功能实现的快速结构概览。
图1:使用MXAM中的工件导航实现快速结构概览

1. Fast Structural Overview

MXAM offers a fast and clear visualization of model structure including subsystem and state chart hierarchies, interface design, as well as objective figures and metrics of the analyzed systems’ properties. MXAM evaluates model complexity on the basis of well-established software metrics and provides detailed information about the number and types of elements used in the model.

本图描述了MXAM的工件导航中的control_logic。
图2:工件导航中的control_logic
本图描述了通过模型度量指标获得模型大小进行实际测量。
图3:通过模型度量指标获得模型大小进行实际测量

2. Realistic Measurement of Model Size

“How big is my model?“ is a question that can be answered easily and objectively with MXAM's "global complexity" metrics. To calculate global complexity, all elements of the analyzed module are taken into account, including the contents of nested subsystems. As the global complexity also reflects the complexity of the implementation it also provides a reliable measure for test and review effort.

本图描述了发动机气体动力学相关的一个Simulink模型。
图4:发动机气体动力学的Simulink模型
本图描述了MXRAY度量中复杂度与非相干度的程度。
图5:MXRAY度量显示的复杂度与非相干度

3. Analysis Down to the Last Detail

The local distribution of the implemented functionality in the model is evaluated with the help of the „local complexity“. MXAM computes this local complexity of subsystems in Simulink, Stateflow, and TargetLink models based on halstead metric volume.

A ratings scale allows complexity hotspots to be identified quickly, i.e., model parts with too high complexity due to unbalanced functionality. As a result of their complexity, these hotspots are empirically more difficult to test and are more prone to errors. Refactoring is often recommended, which can be prioritized using a combination of model metrics available in MXAM.

Evaluating whether a subsystem is especially apt for further partitioning can be done with the help of the "incoherence metric". This metric assesses to which extent a given Simulink subsystem is related to exactly one task, or whether multiple independent tasks are implemented. Refactoring through appropriate partitioning will be easier if the subsystems is less coherent.

本图描述了在子系统中高效查找克隆部分的过程。
图6:使用MXAM发现的克隆部分

4. Effective Search for Clones Among Subsystems

MXAM detects clones and evaluates the internal dependencies of subsystems, helping you to find complex, error-prone model parts and keep model complexity low. This provides you valuable support to meet the essential requirements of ISO 26262 regarding the design of the software architecture. Cloned parts will be found by MXAM even with layout and parameter changes. Thus, frequently reused functions can be safely identified and and centralized through reusable components like referenced models or library subsystems. In this way, model and code size is kept in check.

Your Benefits of Using MXAM to Improve Model Architecture

Transparency

  • Identifies complex model parts (hotspots)
  • Finds duplicated subsystems

Simplification

  • Visualizes model structure
  • Evaluates structural complexity

Metrics

  • Calculates all relevant well-established software metrics on model level
  • Calculates model-specific metrics

Compliance

  • Ensures compliance with safety standards such as ISO 26262/IEC 61508 (Architectural Design Principles Part 6 Chapter 7)
  • Ensures compliance with the quality standard ASPICE (Evaluate software detailed design, Base Practice SWE.3.BP4)

PS: For those of you who know us already for longer: Model metrics and complexity analysis were the main functions of MES' former tool MXRAY. The functionality of MXRAY has been completely integrated into MXAM from MXAM v.6 on. MXRAY therefore is no longer available as a standalone tool.

联系我们

本图片是Elena Bley的肖像照。
Elena Bley
Senior Manager Marketing & Webinars

*必须填写

Please add 5 and 7.