{"id":14188,"date":"2023-10-04T08:58:45","date_gmt":"2023-10-04T06:58:45","guid":{"rendered":"https:\/\/www.btc-embedded.com\/?p=14188"},"modified":"2023-10-13T17:24:31","modified_gmt":"2023-10-13T15:24:31","slug":"best-practices-for-model-based-development-for-embedded-software","status":"publish","type":"post","link":"https:\/\/www.btc-embedded.com\/zh-hans\/best-practices-for-model-based-development-for-embedded-software\/","title":{"rendered":"Best Practices for Model-Based Development for Embedded Software"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"14188\" class=\"elementor elementor-14188\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-3b5f0493 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3b5f0493\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-559a247a\" data-id=\"559a247a\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a1ff07f elementor-widget elementor-widget-text-editor\" data-id=\"a1ff07f\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"letter-spacing: 0px; background-color: var( --e-global-color-8c64e01 );\">Model-based development (MBD) has revolutionized how embedded software is designed, implemented, tested, and maintained.<\/span><span style=\"letter-spacing: 0px; background-color: var( --e-global-color-8c64e01 );\">\u00a0<\/span><span style=\"letter-spacing: 0px; background-color: var( --e-global-color-8c64e01 );\">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.<\/span><span style=\"color: var( --e-global-color-text ); letter-spacing: 0px; background-color: var( --e-global-color-8c64e01 );\"> 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.<\/span><\/p><p>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.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2cb1475 elementor-widget-tablet_extra__width-initial elementor-widget elementor-widget-heading\" data-id=\"2cb1475\" data-element_type=\"widget\" data-settings=\"{&quot;motion_fx_motion_fx_scrolling&quot;:&quot;yes&quot;,&quot;motion_fx_devices&quot;:[&quot;desktop&quot;,&quot;tablet_extra&quot;,&quot;tablet&quot;,&quot;mobile&quot;]}\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">1. Streamlining Data Management - Data Dictionary<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-732d3d4 elementor-widget elementor-widget-text-editor\" data-id=\"732d3d4\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>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. A<span style=\"color: var( --e-global-color-text ); letter-spacing: 0px; background-color: var( --e-global-color-8c64e01 );\">s 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.\u00a0<\/span><\/p><p>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.<\/p><p>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&#8217;s data elements, enabling users to identify data dependencies without analyzing the entire model.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ffe7789 elementor-widget elementor-widget-heading\" data-id=\"ffe7789\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">2. Know your \"Unit\" and its Hierarchy<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-db0e1cc elementor-widget elementor-widget-text-editor\" data-id=\"db0e1cc\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>In Model-based development, a &#8220;Unit&#8221; 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.<\/p><p>The concept of &#8220;Hierarchy&#8221; 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 &#8220;units&#8221;. The hierarchy also establishes relationships between these units. This hierarchical structure allows the developers to encapsulate the subsystems based on the unit&#8217;s functionality. <span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: var( --e-global-typography-text-font-size ); font-style: var( --e-global-typography-text-font-style ); font-weight: var( --e-global-typography-text-font-weight ); letter-spacing: var( --e-global-typography-text-letter-spacing ); text-transform: var( --e-global-typography-text-text-transform ); background-color: var( --e-global-color-8c64e01 );\">These units represent specific parts of the model&#8217;s logic and as time progresses, they contribute to reusability and scalability across different projects.<\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-80e2273 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"80e2273\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-aa3063a\" data-id=\"aa3063a\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8cb647f elementor-widget__width-initial elementor-widget elementor-widget-text-editor\" data-id=\"8cb647f\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>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,<\/p><ul><li><b>Top Subsystem<\/b>:\u00a0<span style=\"background-color: transparent; color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-style: var( --e-global-typography-text-font-style ); font-weight: var( --e-global-typography-text-font-weight ); letter-spacing: var( --e-global-typography-text-letter-spacing ); text-transform: var( --e-global-typography-text-text-transform );\">The schedule layer is positioned at the top. This method makes\u00a0<\/span><span style=\"background-color: transparent; color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-style: var( --e-global-typography-text-font-style ); font-weight: var( --e-global-typography-text-font-weight ); letter-spacing: var( --e-global-typography-text-letter-spacing ); text-transform: var( --e-global-typography-text-text-transform );\">integration with the code easy, but functions are divided, and the readability of the model is\u00a0<\/span><span style=\"background-color: transparent; color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-style: var( --e-global-typography-text-font-style ); font-weight: var( --e-global-typography-text-font-weight ); letter-spacing: var( --e-global-typography-text-letter-spacing ); text-transform: var( --e-global-typography-text-text-transform );\"><span style=\"background-color: transparent; color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-style: var( --e-global-typography-text-font-style ); font-weight: var( --e-global-typography-text-font-weight ); letter-spacing: var( --e-global-typography-text-letter-spacing ); text-transform: var( --e-global-typography-text-text-transform );\">impaired.<\/span><\/span><\/li><li><p><b>Bottom Subsystem<\/b><span style=\"font-weight: var( --e-global-typography-text-font-weight );\">: Function layers are arranged at the top and schedule layers are positioned below the individual function layers.<\/span><\/p><\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-7863d0e\" data-id=\"7863d0e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-bbdef65 elementor-widget elementor-widget-image\" data-id=\"bbdef65\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"682\" src=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2023\/05\/Layers-in-Modelling-.png\" class=\"attachment-large size-large wp-image-14243\" alt=\"Image showing different layers in modelling.\" srcset=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2023\/05\/Layers-in-Modelling-.png 866w, https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2023\/05\/Layers-in-Modelling--768x654.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<div class=\"elementor-element elementor-element-f4dea72 elementor-widget elementor-widget-heading\" data-id=\"f4dea72\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">3. Requirements and Test Driven Development<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6cdaf06 elementor-widget elementor-widget-text-editor\" data-id=\"6cdaf06\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>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.<\/p><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: var( --e-global-typography-text-font-size ); font-style: var( --e-global-typography-text-font-style ); font-weight: var( --e-global-typography-text-font-weight ); letter-spacing: var( --e-global-typography-text-letter-spacing ); text-transform: var( --e-global-typography-text-text-transform ); background-color: var( --e-global-color-8c64e01 );\">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.<\/span><\/p><p><b>However, one might wonder, Can we use models as requirements?<\/b><\/p><p id=\"medium-paragraph\" class=\"medium-paragraph c-code copy-click\">It is important to examine the standards, such as <a href=\"https:\/\/www.automotivespice.com\/\" target=\"_blank\" rel=\"noopener\">ASPICE<\/a> and <a href=\"https:\/\/www.iso.org\/standard\/68386.html\" target=\"_blank\" rel=\"noopener\">ISO26262<\/a>\u00a0when considering whether models can replace requirements.<span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: var( --e-global-typography-text-font-size ); font-style: var( --e-global-typography-text-font-style ); font-weight: var( --e-global-typography-text-font-weight ); letter-spacing: var( --e-global-typography-text-letter-spacing ); text-transform: var( --e-global-typography-text-text-transform ); background-color: var( --e-global-color-8c64e01 );\">\u00a0<\/span><\/p><p>The ASPICE standard emphasizes the importance of detailed design and the ISO26262 standard addresses the Requirements-based-Testing (RBT) for all ASIL levels.\u00a0<\/p><ul><li>In the case of white box requirements, that deal with internal functionality and design, the model can serve as a suitable replacement.<\/li><li>However, for the black box requirements that describe the behavior of interfaces, which serve as references. for model development, external requirements are necessary.<\/li><\/ul><div>\u00a0<\/div><div>To know more about, why and how to improve requirements, feel free to check out the <a href=\"https:\/\/www.btc-embedded.com\/why-and-how-to-improve-requirements\/\">blog article<\/a> from my colleague Wolfgang Meincke.<\/div>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5471b75 elementor-widget elementor-widget-heading\" data-id=\"5471b75\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Conclusion<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-414f299 elementor-widget elementor-widget-text-editor\" data-id=\"414f299\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"background-color: var( --e-global-color-8c64e01 ); color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: var( --e-global-typography-text-font-size ); font-style: var( --e-global-typography-text-font-style ); font-weight: var( --e-global-typography-text-font-weight ); letter-spacing: var( --e-global-typography-text-letter-spacing ); text-transform: var( --e-global-typography-text-text-transform );\">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.<\/span><\/p><p><span style=\"color: var( --e-global-color-text ); font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: var( --e-global-typography-text-font-size ); font-style: var( --e-global-typography-text-font-style ); font-weight: var( --e-global-typography-text-font-weight ); letter-spacing: var( --e-global-typography-text-letter-spacing ); text-transform: var( --e-global-typography-text-text-transform ); background-color: var( --e-global-color-8c64e01 );\">With increasing complexity, we need better handling of Model-based development methods and focus on these points in mind,<\/span><\/p><ol><li>Leveraging existing models or software.<\/li><li>Automated pipeline to migrate or test complex models.<\/li><li>Well pre-defined requirements.<\/li><li>Reusability and scalability of models.<\/li><\/ol><div>\u00a0<\/div><p>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.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Model-based development (MBD) has revolutionized how em [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":14305,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"elementor_theme","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[49],"product":[],"use_cases":[],"class_list":["post-14188","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-model-based-development"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/posts\/14188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=14188"}],"version-history":[{"count":0,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/posts\/14188\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/media\/14305"}],"wp:attachment":[{"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=14188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=14188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=14188"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/product?post=14188"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/use_cases?post=14188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}