All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Model-Based Design Model-based development is an embedded software initiative where a two-sided model is used to verify control requirements and that the code runs on target electronic hardware. One side is the Control Model, representing the embedded software of the system. The architecture of the embedded software…
Deepak Gaur
updated on 27 Nov 2021
Model-Based Design
Model-based development is an embedded software initiative where a two-sided model is used to verify control requirements and that the code runs on target electronic hardware.
One side is the Control Model, representing the embedded software of the system. The architecture of the embedded software is modelled with blocks containing algorithms, functions and logic components. Compiled software is auto-generated from this model.
The other side is the Plant Model, representing the physical aspects of the system. Each block contains mathematics that allows it to emulate the behaviour of that physical system.
Model-Based development process
Model-Based Development- V Cycle
Model-based development and verification approaches are highly desirable in the development of safety-critical embedded systems because they help to identify functional and non-functional issues in the early development stage when verification complexity is relatively lower than that of the implemented systems.
Verification and validation is the backbone of any robust model-based development process. It can be used to check the accuracy of the models and algorithms based on code generated by test hardware and software interactions.
Model Verification by Simulation (MvS)
Testing
Testing is a systematic way to check the correctness of the system by means of experimenting with it. The test is usually carried out on a system in a controlled environment and a verdict is given based on the behaviour during the test. For testing the system several test cases are written to examine several aspects of the system.
Static Techniques and Dynamic Techniques
Dynamic Testing
In Dynamic Testing, a code is executed. It checks for functional behaviour of software system, memory/CPU usage and overall performance of the system.
The main objective of this testing is to confirm that the software product works in conformance with the business requirements. This testing is also called an Execution technique or validation testing.
Dynamic testing executes the software and validates the output with the expected outcome. Dynamic testing is performed at all levels of testing and it can be either black or white box testing.
The following are part of dynamic testing
Static Testing
Static Testing is a software testing technique that is used to check defects in software applications without executing the code. Static testing is done to avoid errors at an early stage of development as it is easier to identify the errors and solve the errors.
Static Testing is done in 2 ways:
Review is of four types:
Testing Techniques
1. Black Box Testing
Black-box testing is a method of software testing that examines the functionality of an application without peering into its internal structures or workings. This method of test can be applied virtually to every level of software testing: unit, integration, system and acceptance.
2. White Box Testing
White-box testing is a method of software testing that tests internal structures or workings of an application, as opposed to its functionality. In white-box testing, an internal perspective of the system, as well as programming skills, are used to design test cases.
3. Grey Box
Grey-box testing is a combination of white-box testing and black-box testing. The aim of this testing is to search for the defects if any due to improper structure or improper usage of applications.
Functional Testing
Functional testing is a type of testing that verifies that each function of the software application operates in conformance with the requirement specification. This testing mainly involves black box testing, and it is not concerned about the source code of the application. Functional Testing is basically defined as a type of testing that verifies that each function of the system application works in conformance with the requirement and specification. Each functionality of the system application is tested by providing appropriate test input, expecting the output and comparing the actual output with the expected output.
Unit Testing: Unit testing involves testing of small fragments of the source code such as operational procedures or individual functions, independent of each other. It is a part of white-box testing. Unit testing, a testing technique using which individual modules are tested to determine if there are any issues by the developer himself. It is concerned with the functional correctness of the standalone modules. The main aim is to isolate each unit of the system to identify, analyze and fix the defects.
Integration Testing: In integration testing, several units that are supposed to interact with each other are integrated and tested to verify the correctness and debug the system. It is a part of white-box testing. Integration testing is the phase in software testing in which individual software modules are combined and tested as a group. Integration testing is conducted to evaluate the compliance of a system or component with specified functional requirements. It occurs after unit testing and before validation testing.
System Testing: It is divided into functional and non-functional testing. In the functional tests, we test the entire system against the specification and requirements. It is done to evaluate the functionality of the system. It is a form of Black box strategy, system testing is done to evaluate the compliance of the system performance with the specifications mentioned in the owner's manual. In non-functional testing, we test the properties such as performance, flexibility, etc.
Acceptance Testing: It is the last level of the validation process. It is performed in a realistic environment and is mostly carried out at the customer end. Acceptance testing is conducted to determine if the requirements of the product specifications are being met as per the contractual obligations at the site.
Non-Functional Testing
Non-functional testing is a type of testing to check non-functional aspects (performance, usability, reliability, etc.) of a software application. It is explicitly designed to test the readiness of a system as per nonfunctional parameters which are never addressed by functional testing.
Functional Testing | Non-functional Testing |
---|---|
It verifies the operations and actions of an application. | It verifies the behaviour of an application. |
It is based on the requirements of the customer. | It is based on the expectations of the customer. |
It helps to enhance the behaviour of the application. | It helps to improve the performance of the application. |
Functional testing is easy to execute manually. | It is hard to execute non-functional testing manually. |
It tests what the product does. | It describes how the product does. |
Functional testing is based on the business requirement. | Non-functional testing is based on the performance requirement. |
Examples:
1. Unit Testing 2. Smoke Testing 3. Integration Testing 4. Regression Testing |
Examples:
1. Performance Testing 2. Load Testing 3. Stress Testing 4. Scalability Testing |
Smoke Testing
In software testing, smoke testing is also known as confidence testing or build verification test (BVT) or build acceptance test. It is preliminary testing to reveal simple failures severe enough to, for example, reject a prospective software release. Smoke tests are a subset of test cases that cover the most important functionality of a component or system, used to aid assessment of whether the main functions of the software appear to work correctly
Regression Testing
Regression testing is re-running functional and non-functional tests to ensure that previously developed and tested software still performs after a change. If not, that would be called a regression.
Dynamic techniques are subdivided into three more categories:
Structure-Based Testing
Structure-based testing techniques use the internal structure of software to derive test cases. They are commonly called 'white-box or 'glass-box techniques. Structure-based techniques can also be used at all levels of testing that is unit testing or component testing, component integration testing, and system and acceptance testing.
Structure-based test design techniques are a good way to help ensure more breadth of testing. To measure what percentage of code has been exercised by a test suite (set of test cases), one or more coverage criteria is used. A coverage criterion is usually defined as a rule or requirement, which a test suite needs to satisfy.
Condition Coverage
Condition coverage is also known as Predicate Coverage in which each one of the Boolean expressions has been evaluated to both TRUE and FALSE.
Example
if ((A || B) && C)
{
<< Few Statements >>
}
else
{
<< Few Statements >>
}
Result
In order to ensure complete Condition coverage criteria for the above example, A, B and C should be evaluated at least once against "true" and "false".
So, in our example, the 3 following tests would be sufficient for 100% Condition coverage testing.
A = true | B = not eval | C = false
A = false | B = true | C = true
A = false | B = false | C = not eval
Decision Coverage
Decision coverage or Branch coverage is a testing method, which aims to ensure that each one of the possible branches from each decision point is executed at least once and thereby ensuring that all reachable code is executed.
That is, every decision is taken each way, true and false. It helps in validating all the branches in the code making sure that no branch leads to abnormal behaviour of the application.
Read A
Read B
IF A+B > 10 THEN
Print "A+B is Large"
ENDIF
If A > 5 THEN
Print "A Large"
ENDIF
The above logic can be represented by a flowchart as:
Result
To calculate Branch Coverage, one has to find out the minimum number of paths which will ensure that all the edges are covered.
In this case there is no single path which will ensure coverage of all the edges at once.
The aim is to cover all possible true/false decisions. (1) 1A-2C-3D-E-4G-5H (2) 1A-2B-E-4F Hence Decision or Branch Coverage is 2.
Modified Condition/Decision Coverage
The Modified Condition/Decision Coverage enhances the condition/decision coverage criteria by requiring that each condition be shown to independently affect the outcome of the decision. This kind of testing is performed on mission-critical applications which might lead to death, injury or monetary loss.
Designing Modified Condition Coverage or Decision Coverage requires a more thoughtful selection of test cases which is carried out on a standalone module or integrated components.
Characteristics of MCDC Coverage
Every entry and exit point in the program has been invoked at least once.
Every decision has been tested for all the possible outcomes of the branch.
Every condition in a decision in the program has taken all possible outcomes at least once.
Every condition in a decision has been shown to independently affect that decision's outcome.
Software in-loop testing
Step 1
Once we have performed all the necessary checks such as the model advisor report to check model compliance as per specific standards, we can say that our model is ready for code generation.
We change the Code Generation parameters as per our system target file, here we choose embedded real-time coder with target language compiler.
Creating an S-function block from the subsystem upon which the software in loop testing is to be performed.
First, we enable "Treat as atomic unit" under "Block Parameters"
Next, we go to the "c/c++ code" option, under which we choose "Generate S-Function" and enable "Create Software-In-the-Loop (SIL) block"
Step 2
Create a test harness model where we take the subsystem to be tested and create a test harness model so that we can compare the results and test the model as per the given requirements.
Step 3
Based on the sample time and the requirement given we write test cases in order to perform software in-loop testing.
Checking the sample time
Defining the test cases
0.01 | 1 | 0 | 0 | 1 | 0 | 0 |
0.02 | 1 | 1 | 0 | 1 | 1 | 0 |
0.03 | 1 | 1 | 1 | 1 | 1 | 1 |
0.04 | 0 | 1 | 0 | 0 | 1 | 0 |
0.05 | 0 | 1 | 1 | 0 | 1 | 1 |
0.06 | 0 | 0 | 1 | 0 | 0 | 1 |
0.07 | 1 | 0 | 1 | 1 | 0 | 1 |
Importing data from excel to signal builder block
Step 4
Converting the signal from the signal builder as per the subsystem requirement.
Step 5
Enabling coverage setting and choosing MCDC as structural coverage type.
Step 6
Running the simulation and analysing the test coverage report.
It is seen that we achieve 100% coverage for both condition and decision.
Generating the coverage report
Coverage Report Summary
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
2D Heat Conduction Simulation
Steady-State Heat Conduction Steady-state conduction is the form of conduction that happens when the temperature difference(s) driving the conduction are constant, so that (after an equilibration time), the spatial distribution of temperatures (temperature field) in the conducting object does not change any further. Thus,…
18 Sep 2023 06:04 PM IST
Design of an Electric Vehicle
Electric Vehicle Electric vehicles are also called Battery Electric Vehicles (BEV). These are fully-electric vehicles with rechargeable batteries and no gasoline engine. Battery electric vehicles store electricity onboard with high-capacity battery packs. Their battery power is used to run the electric motor and all onboard…
18 Sep 2023 05:31 PM IST
Construction of a Simple Multi Cell Battery Pack
Q1a. How weakest cell limits the usable capacity of the battery pack? The weakest cell limits the because it sets a barrier for the entire battery pack to work with limitations. The weak cell may not fail immediately but will get exhausted more quickly than the strong ones when on a load. On charge, the low cell fills…
10 Sep 2023 06:07 PM IST
Battery Thermal Management
Thermal Management All batteries depend for their action on an electrochemical process whether charging or discharging and we know that these chemical reactions are in some way dependent on temperature. Nominal battery performance is usually specified for working temperatures somewhere in the + 20°C to +30°C range…
05 Dec 2021 05:23 PM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.