In the field of model-based development (MBD), the quality of the models is crucial for successful end products. Find out how you can improve the quality of these models and ensure model conformance and quality throughout the development process.

What is Better Modeling?

Better modeling, the approach to creating superior software models, is essential for developing high-quality software. Key aspects of this approach include maintaining a consistent look through careful layout and design, ensuring that objects and information are not hidden or obscured, and following a structured methodology. For instance, signal flow should follow a left-to-right orientation, signal line crossings should be avoided, and the position of block names should be fixed to a specific position for all blocks to maintain consistency. This thorough approach ensures that the models are not only visually clear but also robust and error-free, ultimately leading to improved code quality.

How Can Models Be Made Better?

To achieve better models, it is important to focus on several key aspects. Here is a selection of these in detail:

Figure shows: Signal flow follows a left-to-right orientation, with inports on the left and outports on the right.
Figure 1: Signal Flow with left-to-right orientation

1. Consistent Layout and Design:

Layout and design are important aspects of a good modeling style to create better models with a consistent look. For example, it is essential to identify how many inports and outports the model has. Random modeling styles can have a major impact on the readability and comprehensibility of models, which is why common style guides are used to ensure that models are easily understood, especially for external reviewers.

  • Signal Flow: Signal flow should follow a left-to-right orientation, starting with all inports on the left side of the model and all outports on the right side.
  • Signal Line Crossings: Signal line crossings should be avoided or made explicit.
  • Block Names: The position of block names should be fixed to a specific position for all blocks, e.g. under the blocks.
Readability and Comprehensibility in Signal Flow
Figure 2: Readability and Comprehensibility in Signal Flow

2. Readability and Comprehensibility:

To ensure models are easily understood, common style guides are used, emphasizing that design should not hide or obscure objects and information. For instance, some blocks might be difficult to identify, making it unclear whether they are constants or what their numeric values mean. A well-designed model ensures that blocks are clearly identifiable and appropriately sized, with constants clearly named to avoid confusion.

  • Magic Constants: "Magic constants" which are values whose origins or meanings are not clear, should be avoided. These obscure values can lead to misunderstandings and errors. The style guide recommends naming constants and defining them in the workspace to enhance understanding and maintainability, helping to distinguish different constants and clarify their roles within the model.
  • Signal Naming: Consistent signal naming improves the comprehensibility of the data flow and reduces maintenance efforts. It also supports the understandability of the model in general.

3. Robustness and Error Prevention:

Beyond ensuring a consistent layout and clear readability, modeling style guides also emphasize making models more robust and avoiding error-prone modeling patterns. These guides aim to improve the testability and quality of the generated code. For example, a poorly designed model can lead to functional problems. Consider a product block with three operands; depending on the order of signal flow and the data types, this operation can yield different results, potentially causing errors. To avoid such issues, operations should be modeled in a cascade, where the sequence of operations is clearly defined by the requirements. By taking all recommendations into account and applying the style guides, the resulting model is more robust and reliable, significantly improving its functionality and reducing the likelihood of errors.

  • Strong Data Typing: Data Types of signals and interfaces need to be strongly typed because inconsistent data types may lead to inefficient code, reduced accuracy, or range violations.

How Can Better Models Be Achieved?

Improving model quality in MBD processes is crucial for delivering successful end products. MES Model Examiner® (MXAM) and MES Model & Refactor® (MoRe) are essential tools in achieving this objective. With MoRe now integrated into all MXAM user licenses, users gain access to advanced modeling functions.

MXAM provides comprehensive static analysis, ensuring models conform to standards like AUTOSAR and ISO 26262. It evaluates model structure and metrics, offering optimized methods for checking modeling guidelines. This helps maintain a consistent layout and design, making models visually clear and easy to navigate. Additionally, MXAM performs automated repairs for guideline violations, improving readability and comprehensibility by avoiding "magic constants" and ensuring clear naming conventions.

MoRe complements MXAM by automating the creation of guideline-compliant layouts in Simulink, significantly reducing refactoring time and promoting consistency. This automation helps minimize manual errors, enhancing the robustness and reliability of models. By ensuring operations are modeled in a cascade, MoRe reduces the likelihood of functional problems, leading to more robust and error-free models.

Together, MXAM and MoRe streamline the development process, enabling the creation of models that are consistently designed, easy to understand, robust, and less error-prone. This integration ultimately leads to higher-quality software development and more efficient workflows.

Get in Touch with Us

Elena Bley
Elena Bley
Senior Manager Marketing & Webinars

* Mandatory field

What is the sum of 4 and 5?