loader image

Test Solutions for Simulink Models & Production Code

Virtual Validation for ADAS/AD

How can I create the needed millions of scenarios?

How can I avoid the test explosion problem?

How can I find out if my tests are passed or failed?

Products

Test Solutions for Simulink Models & Production Code

Virtual Validation for ADAS/AD

How can I create the needed millions of scenarios?

How can I avoid the test explosion problem?

How can I find out if my tests are passed or failed?

Blog

Best Practices for Model-Based Development for Embedded Software

Yatish Chitluri

Oldenburg, Germany

Model-based development (MBD) has revolutionized how embedded software is designed, implemented, tested, and maintained. Modern-day cars have over 100 million lines of source code in the ECU, enabling advanced features like adaptive cruise control, lane changing, automated parking, and infotainment. The transition from handwriting code to generating code using models can be a great way to cope with the growing complexity and the need for more sophisticated, safe, and advanced features.

This blog article explores and summarises 3 of the many best practices in Model-based development for embedded software development highlighting the data management during the development process to ensure uniformness through the development team, hierarchical development and testing, and the need for requirements-based testing-driven development.

1. Streamlining Data Management - Data Dictionary

During the initial phases of Model-based development (MBD), data organization and standardization may be absent due to unknown model interfaces. As model complexity grows, managing different data elements can be difficult. As the system and model configuration requirements are defined in the early stages of the V-cycle, it is highly advisable to start streamlining the data using a data dictionary. 

A data dictionary in model-based development is a centralized repository that defines data elements, which are used within a model. It serves as a guide that captures the metadata, attributes, relationships between various elements, and constraints associated with each element. Any changes made in a data element in the data dictionary will be reflected in all models and model elements that are referencing it. This minimizes customizations and helps in reducing the maintenance of models.

Projects can ensure consistent and standardized data representation across all developers by implementing a data dictionary. It also facilitates data-driven analysis and design by providing a comprehensive view of the system’s data elements, enabling users to identify data dependencies without analyzing the entire model.

2. Know your "Unit" and its Hierarchy

In Model-based development, a “Unit” refers to a specific part or module of the system that is being developed. Such as a sub-model, subsystem, or logic-based combination of blocks. These units play a crucial role in modularising and organizing the model. This makes it easier to comprehend, develop, and manage system complexity. Each unit can be designed and developed independently, allowing for parallel development and easier collaboration between multiple teams.

The concept of “Hierarchy” becomes essential when dealing with complex models. In model-based development, a hierarchy refers to the structure of models or components within a model or a system. It offers a way of breaking down a complex model into smaller, more manageable parts, which are “units”. The hierarchy also establishes relationships between these units. This hierarchical structure allows the developers to encapsulate the subsystems based on the unit’s functionality. These units represent specific parts of the model’s logic and as time progresses, they contribute to reusability and scalability across different projects.

Here is an example of how a unit and its hierarchy can be used in different ways in model-based development, depending upon the usage,

  • Top SubsystemThe schedule layer is positioned at the top. This method makes integration with the code easy, but functions are divided, and the readability of the model is impaired.
  • Bottom Subsystem: Function layers are arranged at the top and schedule layers are positioned below the individual function layers.

Image showing different layers in Model-based development. Thick frame represents Atomic subsystem

3. Requirements and Test Driven Development

In Model-based development, Requirements-based test-driven development uses requirements as the foundation for model design and test execution during development. This process integrates requirements, models, and tests to ensure the developed system meets specifications. Tests are developed concurrently with models to verify and validate them, serving as a reference. By directly linking tests to requirements, this approach ensures the system adheres to specified behavior.

The requirements-based test-driven approach enhances communication and collaboration among the stakeholders of the project. This type of development is a perfect example of iterative and incremental development.

However, one might wonder, Can we use models as requirements?

It is important to examine the standards, such as ASPICE and ISO26262 when considering whether models can replace requirements. 

The ASPICE standard emphasizes the importance of detailed design and the ISO26262 standard addresses the Requirements-based-Testing (RBT) for all ASIL levels. 

  • In the case of white box requirements, that deal with internal functionality and design, the model can serve as a suitable replacement.
  • However, for the black box requirements that describe the behavior of interfaces, which serve as references. for model development, external requirements are necessary.
 
To know more about, why and how to improve requirements, feel free to check out the blog article from my colleague Wolfgang Meincke.

Conclusion

Employing such systematic and efficient approaches, helps the developers and testers maintain harmony in the V-Cycle. These practices allow MBD engineers to develop large, complex embedded systems with higher reliability, shorter development time, efficient testing and development, and improved maintainability over time.

With increasing complexity, we need better handling of Model-based development methods and focus on these points in mind,

  1. Leveraging existing models or software.
  2. Automated pipeline to migrate or test complex models.
  3. Well pre-defined requirements.
  4. Reusability and scalability of models.
 

By taking advantage of the power of models and best practices, it is possible to not only enhance the efficiency and quality of the development process but also position organizations at the forefront of innovations.

Yatish Chitluri

Oldenburg, Germany

Application Engineer

Yatish Chitluri received his Master of Science in Mechatronics at the FH Aachen. He worked for 2.5 years at Fraunhofer ILT in Aachen, Germany as a research assistant in the field of Model-based Development methods. In October 2021, Yatish Chitluri joined BTC Embedded Systems AG as an Application Engineer in Oldenburg, Germany, where he supports our worldwide customers with their Model-based Development and Testing toolchains and processes.

Connect on LinkedIn

Popular Videos

Play Video
Play Video

Request Evaluation License

If you would like to try out our tools, we will gladly provide an evaluation license free of chargeEvaluations include a free launch workshop and also provide an opportunity for you to meet one-on-one with our support and engineering teams.

Schedule a Meeting

Do you have any questions or want to see our tools in action? If so, please use the link below to schedule a meeting, where a member of our engineering team will be happy to show you the features and use cases and directly answer any questions you might have.

Events

Join upcoming Webinar

Join our newsletter

Your email address will be submitted to the privacy-certified newsletter software CleverReach for technical distribution. For further information go to our privacy policy.

Videos

Discover some of the main features of our products in these short videos.