{"id":4195,"date":"2020-05-27T09:03:53","date_gmt":"2020-05-27T07:03:53","guid":{"rendered":"https:\/\/zen-cori.138-201-132-86.plesk.page\/?p=4195"},"modified":"2022-09-19T11:45:51","modified_gmt":"2022-09-19T09:45:51","slug":"component-based-architecture-in-simulink-for-efficient-unit-and-integration-test","status":"publish","type":"post","link":"https:\/\/www.btc-embedded.com\/zh-hans\/component-based-architecture-in-simulink-for-efficient-unit-and-integration-test\/","title":{"rendered":"Modular Model-based Software Architecture for Efficient Unit and Integration Test"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"4195\" class=\"elementor elementor-4195\" 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-d83c847 elementor-widget elementor-widget-text-editor\" data-id=\"d83c847\" 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>Model-based design (MBD) is well established in automotive\u00a0<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 );\">to develop embedded software\u00a0<\/span><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 );\">but with the growing size and complexity of software, handling big sized model is often a challenge. MBD enables to easily craft a software application and from one step to another refine it, test it and generate the production code. However, it&#8217;s risky to start modeling without a well-defined software architecture. Because it\u2019s impossible to develop an automotive software as one single function, defining a software architecture helps to break down the complexity and improves the development and testing activities. ISO 26262 addresses software modularity with the principle of \u201cHierarchical structure of software components\u201d and highly recommends it for all ASIL levels. In this article, we\u2019ll see how this principle can be applied using a component-based architecture in Simulink. F<\/span><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 );\">irst of all, let\u2019s start with some definitions.<\/span><\/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-7c099a8 elementor-widget elementor-widget-heading\" data-id=\"7c099a8\" 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\">What is a software architecture?<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\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>Defining the software architecture is an important step to ensure an efficient development of complex software.<\/p><p><i><b>Note<\/b>: A software application can be modeled for Rapid Prototyping without a detailed software architecture definition but later in the development process, testing a piece of the software in Software-In-the-Loop (SIL) will be impossible if the corresponding function is not present in the production code.<\/i><\/p><p>The software architecture describes the elements that constitute the software and their interactions. This includes static aspects such as the hierarchical structure, executable functions, interface variables, datatypes, etc. as well as dynamic aspects such as execution modes\/timing\/order, temporal constraints.<\/p><p>In many projects we observe that the notion of software hierarchy is present but the definitions are not standardized. \u00a0We often hear terms like \u201cModule\u201d, \u201cFeature\u201d, \u201cFunction\u201d, \u201cUnit\u201d, \u201cComponent\u201d, \u201cApplication\u201d, etc. but from one project to another, they are used differently. In the\u00a0<a href=\"https:\/\/www.autosar.org\/fileadmin\/user_upload\/standards\/classic\/20-11\/AUTOSAR_TPS_SoftwareComponentTemplate.pdf\" target=\"_blank\" rel=\"noopener\">AUTOSAR standard<\/a>, there are three levels of hierarchy with standardized definitions: Composition, Atomic Software Component and Runnable. The Runnables are the executable software entities and the Atomic Software Component and Composition are encapsulation levels. In<a href=\"https:\/\/www.iso.org\/standard\/68388.html\" target=\"_blank\" rel=\"noopener\">\u00a0ISO 26262\u00a0Part 6<\/a>\u00a0we see two terms: Software components and Software unit. The Software unit is considered to be the lower level piece to design the software and a software component gathers one or multiple software units in an encapsulation fashion. Independently from the terms being used, the concept behind a hierarchy of dependencies shall be clearly defined in the organization. Nevertheless, if a project has to comply with a standard, it\u2019s recommended to use the same definition and wording of the standard. In this article, we\u2019ll describe the component-based architecture in Simulink using the terms of the ISO 26262 standard: Software component and Software unit.<\/p><p><span style=\"color: var( --e-global-color-text ); letter-spacing: 0px; background-color: var( --e-global-color-8c64e01 );\">Ultimately, a dedicated tool shall be used t<\/span>o design the software architecture. For AUTOSAR architecture, it makes sense to use an AUTOSAR authoring tool but in general, professional software architecture tools offer sufficient features and abstraction to design the architecture. For more efficiency in the model-based context, it\u2019s recommended to use a tool which easily integrates with the model-based environment.<\/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-27e953f elementor-widget elementor-widget-heading\" data-id=\"27e953f\" 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\">What\u2019s a software unit?<\/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>According to ISO 26262, a software unit is an atomic level of a software component that can be subject to standalone testing. One or more software units constitute a software component.<\/p><p><strong>Characteristics of a software unit<\/strong><\/p><ul><li>It can be designed, implemented and tested separately, independently of the remaining software.<\/li><li>It implements a well-defined set of requirements with bi-directional traceability.<\/li><li>It\u2019s independent in a way that it can be implemented by one single developer<\/li><li>It has a high self-cohesion: it\u2019s atomic, focuses on one functionality and its dependencies to other units is reduced to well defined interface variables.<\/li><li>It can be reused across multiple software applications.<\/li><\/ul><p><strong 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 ); 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<\/strong><\/p><p><strong 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 ); 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 );\">Size and complexity<\/strong><\/p><p>There are no systematic ways to define the ideal size of a unit (e.g. in terms of numbers of blocks\/signals in the model-based context) but the ISO standard recommends to restrict the size of software components<b>,<\/b>\u00a0the number of interfaces and describes methods to reduce the complexity. In general, we see that the size and complexity can be balanced between few aspects:<\/p><ul><li>From the <b>perspective of the function developer\/tester<\/b>, it shall be possible to analyze and understand the allocated set of requirements.<\/li><li>The <b>functionality itself<\/b>: an appropriate algorithm shall be chosen to implement the function considering that embedded software is a limited world. (e.g. the ideal mathematical solver cannot always be chosen).<\/li><li><b>Smart coupling<\/b>: Highly dependent functionalities shall reside inside the same unit as much as possible while decoupled features shall be split into different units.<\/li><li><b>Guidance of technical criteria<\/b>: metrics from complexity analysis tools, hardware resource consumption limits, software partitioning, criteria such as freedom-from-interference, etc.<\/li><\/ul>\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-8f3060b elementor-widget elementor-widget-heading\" data-id=\"8f3060b\" 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\">From software architecture to component-based architecture in Simulink<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6ec190f elementor-widget elementor-widget-text-editor\" data-id=\"6ec190f\" 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 Simulink, one model usually implements a software component. The model structures the implementation using subsystem blocks. A subsystem gathers a subset of functionalities usually derived from the requirements. Subsystems can be virtual and non-virtual (aka atomic). Virtual subsystems are meant for readability\/traceability and reduction of visual complexity while atomic subsystems, in addition to that, have an influence on the behavior: the content of an atomic subsystem is executed all at once. Therefore, non-virtual subsystems are suitable to model software units. Defining an atomic subsystem will:<\/p><ul><li>reveal unwanted dependencies to the remaining model like algebraic loops, external events signals crossing the unit boundaries, etc.<\/li><li>guarantee the atomic execution of the subsystem operations in the generated code<\/li><li>enable to generate the subsystem as an individual c-function.<\/li><\/ul><div>\u00a0<\/div><p>Within a\u00a0<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 );\">software unit\u00a0<\/span><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 );\">atomic subsystem, it\u2019s also possible to have smaller atomic subsystems for inner implementation purposes like conditional execution parts, reusable functions or to split the unit into smaller functions for resource management in the code.<\/span><\/p><p>Ultimately, the resulting structure of the software component model is composed of horizontal and vertical hierarchy subsystems connected via data and control signals.<\/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-1e8b517 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"1e8b517\" 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-39a411b\" data-id=\"39a411b\" 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-0ff2f37 elementor-widget elementor-widget-image\" data-id=\"0ff2f37\" 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<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic1-1920x1920-7b6.jpeg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"pic1-1920x1920-7b6\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6ODA1MCwidXJsIjoiaHR0cHM6XC9cL3d3dy5idGMtZW1iZWRkZWQuY29tXC93cC1jb250ZW50XC91cGxvYWRzXC8yMDIwXC8wNVwvcGljMS0xOTIweDE5MjAtN2I2LmpwZWcifQ%3D%3D\">\n\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"289\" src=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic1-1920x1920-7b6.jpeg\" class=\"attachment-large size-large wp-image-8050\" alt=\"component-based-architecture-in-Simulink-modecode\" srcset=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic1-1920x1920-7b6.jpeg 951w, https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic1-1920x1920-7b6-768x277.jpeg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Example of hierarchical structure<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\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<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-fb4351b\" data-id=\"fb4351b\" 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-f35b518 elementor-widget elementor-widget-text-editor\" data-id=\"f35b518\" 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>Although a model can represent the hierarchical structure of a software component, it may not support further aspects like distributed development, maintainability, reusability, testability of the individual software units if it uses pure subsystems blocks. Indeed, the scope of these blocks is limited to the model itself.<\/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 class=\"elementor-element elementor-element-7303e71 elementor-widget elementor-widget-heading\" data-id=\"7303e71\" 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\">Simulink component-based modeling using Library blocks or Model references<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-79c29f9 elementor-widget elementor-widget-text-editor\" data-id=\"79c29f9\" 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>Simulink supports a \u201ccomponent-based\u201d modeling style allowing to segment a model into separate and independent models which can be integrated together via reference and link mechanisms. With this approach, each model can represent a software unit and be designed, simulated and tested individually. The integrated model can thus represent the software component. Two techniques are available for this purpose and here are their main characteristics:<\/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-ad22db3 elementor-widget elementor-widget-image\" data-id=\"ad22db3\" 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 decoding=\"async\" width=\"800\" height=\"363\" src=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2022\/05\/Blog_ModularMBS_Tab1.png\" class=\"attachment-large size-large wp-image-8095\" alt=\"\" srcset=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2022\/05\/Blog_ModularMBS_Tab1.png 3272w, https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2022\/05\/Blog_ModularMBS_Tab1-768x349.png 768w, https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2022\/05\/Blog_ModularMBS_Tab1-1536x697.png 1536w, https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2022\/05\/Blog_ModularMBS_Tab1-2048x929.png 2048w\" 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<div class=\"elementor-element elementor-element-190a8e8 elementor-widget elementor-widget-text-editor\" data-id=\"190a8e8\" 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>Each technique or both combined can be applied for component-based architecture in Simulink. It&#8217;s possible to create a folder structure to organize the different models and synchronize the files in a software configuration management tool for versioning, etc.<\/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-4212310 elementor-widget elementor-widget-image\" data-id=\"4212310\" 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<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"800\" height=\"513\" src=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic2-1756x-859.jpeg\" class=\"attachment-large size-large wp-image-8052\" alt=\"component-based-architecture-in-Simulink-folderstructure\" srcset=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic2-1756x-859.jpeg 980w, https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic2-1756x-859-768x493.jpeg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Example of folder structure for component-based modeling<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\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-b404e37 elementor-widget elementor-widget-text-editor\" data-id=\"b404e37\" 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><i><b>Note<\/b>: The reference between the software unit models and the models of higher architecture levels can use either of one the two techniques (Library or Model reference). With the library option, the software unit is an atomic subsystem block stored in a library model and the frame model instantiates the Subsystem block. With the Model reference option, the software unit is the model itself and the frame model uses a Model block to reference it.<\/i><\/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-9e3dda9 elementor-widget elementor-widget-heading\" data-id=\"9e3dda9\" 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\">Unit and integration tests with the modular structure<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7d58211 elementor-widget elementor-widget-text-editor\" data-id=\"7d58211\" 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>ISO 26262 recommends similar test methods on unit and integration levels. For instance, Requirements-based testing can be carried on the unit and integration models however the granularity of the requirements is not the same. On the integration level, the requirements will talk about more high-level behavior of the system while on unit level they will describe the algorithm details. Therefore, the test quality criteria on both levels are different. Unit tests shall verify that there\u2019s no unintended functionalities by looking at the metrics of requirements coverage and structural coverage \u00a0\u201cStatement\u201d, \u201cBranch\u201d and \u201cMC\/DC\u201d. Integration test mostly looks at the requirements coverage and also addresses \u201cFunction\u201d and \u201cFunction Call\u201d coverage.<\/p><p><i><b>Note<\/b>: Before performing the integration tests, the software units shall be sufficiently tested to increase the confidence on each unit so the problems occurring during the integration would most likely be reduced to the scope of the interaction between the units and not individual malfunctions.<\/i><\/p><p>The picture below illustrates the possible relationship between the models and the test projects:<\/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-bc78448 elementor-widget elementor-widget-image\" data-id=\"bc78448\" 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<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"433\" src=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic3-1756x-859.jpeg\" class=\"attachment-large size-large wp-image-8053\" alt=\"component-based-architecture-in-Simulink-testprojects\" srcset=\"https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic3-1756x-859.jpeg 843w, https:\/\/www.btc-embedded.com\/wp-content\/uploads\/2020\/05\/pic3-1756x-859-768x415.jpeg 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Relationship between models and test projects for unit and integration tests. (*) .epp file is the test project created with the tool BTC EmbbeddedPlatform<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\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-720bba8 elementor-widget elementor-widget-text-editor\" data-id=\"720bba8\" 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>With such modular structure, it\u2019s easier to manage the complexity. Software units can have relatively small size. They can be designed and tested individually. Code generation, test execution and debugging are faster making the development iterations more agile. Automatic test generation for test methods like Back-To-Back Test perform much better on smaller units. Moreover, when requirements change, only the corresponding model and related tests need to be updated. All these make the approach highly suitable for agile-based software development.\u00a0\u00a0<\/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-520765e elementor-widget elementor-widget-heading\" data-id=\"520765e\" 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-4ebe4e6 elementor-widget elementor-widget-text-editor\" data-id=\"4ebe4e6\" 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>The component-based architecture in Simulink allows to handle large software models by breaking the model down into smaller ones. Each smaller model can represent and fulfill the characteristics of a software unit. The software development can be performed on the software unit models and these models are later assembled via sophisticated reference mechanisms to support the next activities like integration test. The reference mechanism allows to keep the referencing models up-to-date with regards to the referenced model. Hence, testing can be performed on unit and integration levels and always execute the original software unit.<\/p>\n<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-decoration-line: ; text-transform: var( --e-global-typography-text-text-transform ); background-color: var( --e-global-color-8c64e01 );\">It&#8217;s clear that the decomposition of the software architecture&nbsp;<\/span><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-decoration-line: ; text-transform: var( --e-global-typography-text-text-transform ); background-color: var( --e-global-color-8c64e01 );\">requires additional effort in early project phases&nbsp;<\/span><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-decoration-line: ; text-transform: var( --e-global-typography-text-text-transform ); background-color: var( --e-global-color-8c64e01 );\">but in the end, the resulting modularity enables to successfully manage software complexity and increases the efficiency of the development process throughout the software life cycle.<\/span><\/p>\n<p><i><b>Note<\/b>: It is technically possible to convert an existing large model into component-based model. This can be time-consuming (e.g. model restructuring, introduction of new interface variables, fixing algebraic loops, performing regression test, etc.) but as a one-time modification, it can be worth to do it to improve your process.<\/i><\/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 design (MBD) is well established in automot [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":9047,"comment_status":"open","ping_status":"closed","sticky":false,"template":"elementor_theme","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1],"tags":[50,49,48,51],"product":[],"use_cases":[],"class_list":["post-4195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-automatic-code-generation","tag-model-based-development","tag-simulink","tag-targetlink"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/posts\/4195","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/comments?post=4195"}],"version-history":[{"count":0,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/posts\/4195\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/media\/9047"}],"wp:attachment":[{"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/media?parent=4195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/categories?post=4195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/tags?post=4195"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/product?post=4195"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.btc-embedded.com\/zh-hans\/wp-json\/wp\/v2\/use_cases?post=4195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}