Autosarhandbookv1 190109141918
Autosarhandbookv1 190109141918
Autosarhandbookv1 190109141918
AUTOSAR
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Handbook
Index
Press
here
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Study
(RTOS) Basics
Study
AUTOSAR OS
Which is based on
OSEK/VDX
Study
Study Automotive
protocols/Models
AUTOSAR Basics (CAN, TTCAN, CANFD, LIN
and FlexRay)
Solve Technical
Exams/interview questions
Automotive Press
here
embedded system
#LEARN_IN DEPTH
#Be_professional_in
(10 parts)
embedded_system
Step 1
Study the
following
You should Study well the Following parts: Parts
All the below topics materials are placed here:
https://www.facebook.com/groups/embedded.system.KS/permalink/8871
60458114320/
If you don’t have a time you just need to see the Step 2
Following C conclusion, if you already aware for validate you
them so you can skip the step 1. are aware for
Note: you will find the conclusion in this revision those
conclusion or
not
ENG. Keroles Shenouda
https://www.facebook.com/groups/embedded.system.KS/
Follow us
Automotive Press
here
embedded system
#LEARN_IN DEPTH
#Be_professional_in
embedded_system
Step 3
Solve the C
Solve the Corner questions/tricks for all the Tricks/questions
covered C topics
RTOS Conclusion
OS Application
Write your application on the top of the Operating System.
On desktop computers, the selection of an operating system (OS) is
largely a matter of taste - Windows vs Apple vs Linux. There is
relatively little choice.
For an embedded system, the matter is much more complex. The
large number of options available reflect the wide diversity of
embedded applications.
• Windows IOT
• Linux Command
• Graphical GUI “ex.QT application”
• C/C++ app.
• RTOS Tasks
• Autosar SW Component OS
Application
Embedded windows
Embedded Linux
• Linux Kernel “Linux.org”
• Open embedded YOCTO
• Android OS
RTOS
• Free RTOS Autosar
• μC/OS-III
• RTOS OS + BSW +RTE
Drivers
Embedded Linux Drivers
RTOS Drivers
MCAl Layer
Memory Management
• In multiprogramming, OS decides which
process will get memory when and how much.
•Allocates the memory when the
process requests it to do so.
•De-allocates the memory when the
process no longer needs it or has been
terminated.
• Sometimes if the CPU hardware “MMU”
provides mapping between virtual and
physical addresses, the OS “memory
management” will manage the Virtual
memory for each task
Kernel
The Kernel is the smallest portion of the OS
that provides these functions
• Scheduler
–Determines which task will run and when it will
do so
•Dispatcher
–Performs the necessary operations to start the
task
•Intertask or interprocess communication
–Mechanism for exchanging data and information
between tasks and processes on the same
machines or different ones
• Performance:
functions) to perform the desired
• Fast enough.
operations (background).
• Compactness • Interrupt Service Routines (ISRs)
• Small and efficient. handle asynchronous
• Scalability events (foreground).
• Result of modularity and RTOS
configurations to be used in many So Foreground is also called
systems. interrupt level while background is
called task level
Background
Handling an Interrupt
ISR ISR
1. Normal ISR
program Foreground
(more
execution importa
nt)
2. Interrupt 3. Processor
occurs state saved
4. Interrupt routine runs
7. Normal
program
execution
resumes
Non-
reentrant
function
Process or Task
• A task is usually implement in C by writing a function
Task 1 Task 2
• When a C function is executing, it is called a process or task
• So Task is not code int x;
• Two tasks can be executing the same code simultaneously
Task States
Waiting
Preemptive
• the highest priority task (ready) is given control Low-priority Task
of the CPU
• current running task is suspended IS
R
• after an Interrupt Service Routine (ISR), the new High-priority Task
highest priority task is run
• Most commercial real-time kernels are ISR makes the
preemptive high-priority task ready
advantages:
- responsiveness is optimal & deterministic
(Execution of the highest-priority task is deterministic)
-Task-level response time is minimized
disadvantages:
high-priority task
- shared resources must be properly guarded
Relinquishes the CPU
-Should not use non-reentrant functions unless
exclusive access to these functions is ensured
ENG. Keroles Shenouda Time
https://www.facebook.com/groups/embedded.system.KS/
Scheduler Concepts
• CPU utilization : keep the CPU as busy as possible.
How much of CPU (usually in %) is in use ?
• Throughput : number of processes (# pf processes) that complete their
execution per time unit.
• Turnaround : total time between submission of a process and its completion.
(waiting + executing + IO Time)
• Waiting time : a mount of time a process has been waiting in the ready
queue.(task enters by System initially), then it is placed in “ready state” when
the conditions are met.
• Response time : amount of time it takes from when a request was submitted
until the first response is produced.
1. First-Come First-Served
Scheduling Algorithms in 2. Shortest Job First
3. Round Robin
time-shared System 4. Round-robin with priority
scheduling
Scheduling - priorities
• static
• the priority of a task is set at compile time and does not change during application execution
advantage:
all timing constraints can be known at compile time
disadvantage:
may get priority inversion
• dynamic
• each task can change its priority during execution
advantage:
useful in avoiding priority inversion
disadvantage:
not easy to guarantee schedulability
ENG. Keroles Shenouda
https://www.facebook.com/groups/embedded.system.KS/
Priority Inversions
• Low-priority process acquires
lock, blocks higher-priority
process
• Priority inheritance temporarily
raises process priority
• Difficult to analyze
Shared Resource
Resource
A shared resource is a
A resource is any entity used
resource that can be used by
by a task. A resource can thus
more than one task. Each task
be an I/O device such as a
should gain exclusive access
printer, a keyboard, a display,
to the shared resource to
etc. or a variable, a structure,
prevent data corruption. This
an array, etc.
is called Mutual Exclusion.
mutex
• A critical section is a piece of code (part of a
function) from which the access to the shared
resource must be atomic. At a certain moment in
time, one and only one critical section is allowed to
access the shared data
• The mutex implements two operations:
• acquire: enter the critical section, or sleep if another
task has already acquired the mutex, and
• release: leave the critical section. Other tasks now have
the possibility to acquire the mutex.
Mutual Exclusion
Disable preemption (Task
Switching) Mechanism
disabling scheduling
instead of disabling all maskable
interrupts, you may just want to
disable the scheduler
an interrupted task is
returned to, not necessarily
the highest priority task
implies that data is not shared with
the ISRs
Encapsulated semaphores
Principle:
task does not have to control semaphore
Resource controls the semaphore
Typical: driver of the resource solves
semaphores
Release of a semaphore is done through a
timeout
eg. Network card, serial port, ...
Advantages:
tasks just use the driver
programmer does not have to deal with the
semaphores
Deadlock
Two tasks waiting for each
others semaphore
How ?
Use of semaphores
"unilateral rendezvous"
Synchronization : Use of
semaphores
• one task can be synchronized
with another (no data
transferred) by using a
semaphore 2. Post 1. Pend
Task 2 Task 1
• the semaphore is a flag
signaling the occurrence of an
event (vice a key for mutex)
• in this case, the semaphore is
initialized to 0
"bilateral rendezvous"
• bilateral rendezvous - two tasks can
be synchronized with each other by
using two separate semaphores
Task 2 Task 1
AUTOSAR OS based on
OSEK-VDX Standard
Conclusion
OSEK/VDX OS
Services of OSEK:
• Task services
• Synchronization services (events)
• Mutual exclusion services
(resources)
• One-shot and periodical services
(counters and alarms)
• Interrupt management services
• Communication services
• System services and error
management
“Mixed”:
Each task may be configured as
preemptable or non-preemptable
It is the most flexible model.
For instance, a very short task (in
execution time) may be configured as
non-preemptable because the context
switch is longer than its execution.
Processing Levels
The OSEK operating system enables a
controlled real-time execution of
several processes which appear to run
in parallel
Entities which are competing for the
CPU are:
Interrupt service routines
Tasks
OSEK defines three processing levels:
Interrupt level
Logical level for scheduler
Task level
Priority rules:
Interrupts have precedence
over tasks
ENG. Keroles Shenouda
https://www.facebook.com/groups/embedded.system.KS/
Tasks in OSEK
• Tasks are « active » elements of the application
• 2 categories of tasks exist in OSEK/VDX:
Extended tasks
Basic tasks The task that are able to wait
A basic task is a sequential C for an event are called
code that must terminate Extended tasks
TASK(myTask)
{
//Task’s instructions
…
//Task_Service API
}
Events’ services
StatusType SetEvent(TaskType <TaskID>, EventMaskType <Mask>);
This service is not blocking and may be called from a task or an ISR2
ISR category 1 The ISR does not use ISR category 2 The OSEK operating system
an operating system service8. After the provides an ISR-frame to prepare a
ISR is finished, processing continues
run-time environment for a dedicated user
exactly at the instruction where the
interrupt has occurred, i.e. the interrupt routine. During system generation the
has no influence on task management. user routine is assigned to the
ISRs of this category have the least interrupt.
overhead. May (must?) do system calls (activate a task, get
a resource, …)
Are not allowed to do system calls;
• Roughly the same behavior as a task
• ISR1 are ignored by the operating • they have a priority (greater than the higher
priority of tasks).
system and defined as classical ISR2 priority is a logical one and not be related
to the hardware priority level.
interrupts: • they have a context (registers, stack, …)
• Init interrupt registers of the • In addition an ISR2
hardware peripheral; • is associated to a hardware interrupt
(triggered by an event)
• Init the related interrupt mask
• Do not touch the other interrupt
To use an ISR2, it is necessary to
• declare it in the OIL file with the
masks (which are managed by the interrupt source identifier (depends on the
operating system). target platform) to indicate where the interrupt
handler is installed;
• initialize the related interrupt registers
of the peripheral which will trigger
the interrupt.
ENG. Keroles Shenouda
https://www.facebook.com/groups/embedded.system.KS/
ISR1
ISR2
Example on ISR2
Counter
Set an event Activate a task
The counter is an abstraction of the hardware
alarm-callback routine “tick” source (timer, interrupt source, ...)
The “tick” source is heavily dependent of
• An alarm is connected to a counter an the target platform;
performs an action. The counter is a standard component;
• An alarm is associated to 1 counter At least one counter is available:
• A counter may be used for several SystemCounter
alarms No system call to modify the
• When the counter reach a value of counters.
the alarm (CycleTime, AlarmTime), Their behavior are masked by the
the alarm expires and an action is alarms.
performed:
A hardware interrupt must be
• Activation of a task;
• Signalization of an event;
associated to a counter
• alarm-callback routine
Alarms’ services
Internal Resources
• OSEK-OS offers the possibility of defining internal resources.
• These resources are not handled and released by using GetResource
and ReleaseResource but they are automatically reserved and released by
the system at Begin and finish a task.
Tasks group
This feature allow to mix non-preemptable tasks and preemptable tasks.
In the same group all the tasks are seen as non-preemptable by the other
tasks of the group.
A task having a higher priority of all the tasks of the group (and not part of the
group) may preempt any task of the group.
This feature uses an internal resource for each group:
The internal resource is got automatically when the task start to run;
The internal resource is released automatically when the task terminates;
An internal resource may not be reference with GetResource() or
ReleaseResource().
AUTOSAR Basics
SWC
Application Layer
The purpose of the application
layer is to provide the actual
functionality of the system.
This is done through the usage of
SWCs, which are components
containing software.
An application consists of one or
You should
configure all
those modules,
but we just will
focus on the
AUTOSAR OS
Automotive
Modules/Protocols
Proposed by the CAN in Automation (CiA) group and Bosch and currently specified in the ISO 11898-
4 standard
Introduction to AUTOSAR, Stephen Waldron, Vector webinar Tuesday 5th May 2015
https://vector.com/portal/medien/cmc/events/Webinars/2015/Vector_Webinar_AU
TOSAR_Introduction_20150505_EN.pdf
Applying AUTOSAR in Practice Available Development Tools and Migration Paths Master Thesis, Computer
Science Authors: Jesper Melin
http://www.idt.mdh.se/utbildning/exjobb/files/TR1171.pdf
Freescale AUTOSAR Software Overview.pdf
AUTOSAR Configuration Process - How to handle 1000s of parameters Vector Webinar 2013-04-19
https://vector.com/portal/medien/cmc/events/Webinars/2013/Vector_Webinar_AUTOSAR_Configuration_Process
_20130419_EN.pdf
The AUTOSAR Adaptive Platform for Connected and Autonomous Vehicles, Simon Fürst, AUTOSAR
Steering Committee 8th Vector Congress 29-Nov-2016, Alte Stuttgarter Reithalle, Stuttgart, Germany
https://vector.com/congress/files/presentations/VeCo16_06_29Nov_Reithalle_Fuerst_BMW.pdf
A Review of Embedded Automotive Protocols, Nicolas Navet1, Françoise Simonot-Lion2 April 14, 2008
https://www.realtimeatwork.com/wp-content/uploads/chapter4_CRC_2008.pdf
AUTOSAR Adaptive Platform
https://vector.com/conference_india/files/presentations/Day1/3_AUTOSAR%20Adaptive%20Platform.pdf
http://www.autosar.org/about/technical-overview/ecu-software-
architecture/autosar-basic-software/
http://www.autosar.org/standards/classic-platform/
https://automotivetechis.files.wordpress.com/2012/05/communicat
ionstack_gosda.pdf
https://automotivetechis.files.wordpress.com/2012/05/autosar_ppt
.pdf
https://automotivetechis.wordpress.com/autosar-concepts/
https://automotivetechis.files.wordpress.com/2012/05/autosar_exp
_layeredsoftwarearchitecture.pdf
http://www.slideshare.net/FarzadSadeghi1/autosar-software-
component
https://www.renesas.com/en-
us/solutions/automotive/technology/autosar/autosar-mcal.html
https://github.com/parai/OpenSAR/blob/master/include/Std_Types.
h
RTOS Questions
2) What are the different types of semaphores in vxworks RTOS? Which is the fastest?
VxWorks supports three types of semaphores.
1) Binary 2) mutual exclusion, and 3)counting semaphores.
Fastest : Binary semaphore.
for(;;)
{
}
//or
label:
//This is is tricky assembly version
goto label:
6) What is the difference between Structure and union? Where do we use union?
When a structure is defined the compiler allocates memory for all of its member variables with
necessary alignment .Whereas for unions the compiler allocates memory for the highest the union is
equal to the biggest size of member from the union member variable list.union can only store
information in one field at any one time.
#include <stdio.h>
struct mStruct
{
char name[10];
int age;
float height;
};
union mUnion
{
char name[15];
int age;
float height;
};
int main(void)
{
union mUnion uTest;
struct mStruct sTest;
strcpy(sTest.name,"sTest");
sTest.age = 20;
sTest.height = 6.1;
strcpy(uTest.name ,"uTest");
uTest.height = 6.0;
uTest.age = 20;
printf("\n");
printf("sizeof(uTest) = %d ,sizeof(sTest) = %d
\n",sizeof(uTest),sizeof(sTest));
printf("uTest.age = %d , uTest.height = %f , uTest.name =
%s\n",uTest.age, uTest.height, uTest.name);
printf("sTest.age = %d , sTest.height = %f , sTest.name =
%s\n",sTest.age, sTest.height, sTest.name);
printf("\n");
}
7) Convert number 2 --> 37 without using any other operator but bitwise ?
Answer:
int x = 2;
printf("X before :%d\n",x);
x = (x<<x<<x) | (x<<x<<x) | x<<!!x | !!x ;
printf("X After :%d\n",x);
// toggle a bit
int8_t toggleBit(int8_t result, int whichBit)
{
return (result ^= (1<<whichBit));
}
mutex acquire and release happens in the same task. we use it to protect our critical section... and with
special features like priority inheritance, task deletion safety
however binary semaphores are not just used for critical section protection but also for process
synchronization....
meaning like raising an event so that the pending tasks wakes the moment the semaphore is available
isr will release a semaphore and a task waiting for it will unpend
so we can serialize the threads or tasks
3. Is unix a multitasking or multiprocessing operating system? whats the difference between the
two?
- unix is a multitasking operating system, multiprocessing means it can run on multiple processors, the
multiproceesing os coordinates with multiple processors running in parallel.
6. windows also has multiple processes has process priotities switches between multiple process, how
RTOS is different from that?
- RTOS has predictable timing constranints
- We can use the fork system call to create a process in UNIX and in OSE the system call create_process
is used.
Paging
- Paging is a techinque where in the OS makes available the data required as quickly as possible. It stores
some pages from the aux device to main memory and when a prog needs a page that is not on the main
memory it fetches it from aux memory and replaces it in main memory. It uses specialised algorithms to
choose which page to replace from in main memory.
Caching
- It deals with a concept where the data is temperorarily stored in a high speed memory for faster
access. This data is duplicated in cache and the original data is stored in some aux memory. This
concepts brings the average access time lower.
Segmentation
- Segmentation is a memory management scheme. This is the technique used for memory protection.
Any accesses outside premitted area would result in segmentation fault.
Virtual Memory
- This technique enables non-contiguous memory to be accessed as if it were contiguous. Same as
paging.
10. write a code to check whether a stack grows upwards or downwards?
void checkStack()
int i=2;
int j=3;
For process synchronization, it is a mechanism to invoke the sleeping process to become ready for
execution. Its mechanism where a process can wait for resources to be available.typical example is
producer consumer process. The producer process creates resources and signals the semaphore saying
resource is available. Consumer process waiting on the semaphore gets the signal that resource is
available.
12. write a small piece of code protecting a shared memory variable with a semaphore?
int global_i;
void increment_shared_memory {
wait(semaphore);
global_i++;
signal(semaphore);
}
13. what are the different types of semaphores and where they are used?
Binary semaphore and counting semaphore. Binary semaphore is same as mutex. Binary semaphore
tries to protect only one resource.
Counting semaphore is used in case of multiple resource. For ex: we have 4 printers then the counting
semaphore value will be init to 4. When it reaches 0, the task waiting on the semaphore is suspended.
16. what are the different segments of a program (code, data,stack,heap etc)
Code segment
- This phrase used to refer to a portion of memory or of an object file that contains executable computer
instructions. It is generally read-only segment.
data segment
- This is one of the sections of a program in an object file or in memory, which contains the global
variables that are initialized by the programmer. It has a fixed size, since all of the data in this section is
set by the programmer before the program is loaded. However, it is not read-only, since the values of
the variables can be altered at runtime.
.bss
This segment of memory is part of data segment that contains uninitialized data (static variables). These
are initialized to 0 and later assigned values during runtime.
stack segment
- This segment of memory is a special stack which stores information about the active subroutines of a
task. It contains the return address to be branched to after a sub-routine has finished execution. It
contains local variables of the sub-routines and the parameters that are passed to those sub-routines.
heap segment
- The segment of memory which is used for dynamic memory allocation is known as heap. It is the
responsibility of the programmer to deallocate it after its use. Or alternatively it will be garbage
collected by the OS.
Is a key to a toilet. One person can have the key - occupy the toilet - at the time. When finished, the
person gives (frees) the key to the next person in the queue.
Officially: "Mutexes are typically used to serialise access to a section of re-entrant code that cannot be
executed concurrently by more than one thread. A mutex object only allows one thread into a
controlled section, forcing other threads which attempt to gain access to that section to wait until the
first thread has exited from that section."
Ref: Symbian Developer Library
Semaphore:
Is the number of free identical toilet keys. Example, say we have four toilets with identical locks and
keys. The semaphore count - the count of keys - is set to 4 at beginning (all four toilets are free), then
the count value is decremented as people are coming in. If all toilets are full, ie. there are no free keys
left, the semaphore count is 0. Now, when eq. one person leaves the toilet, semaphore is increased to 1
(one free key), and given to the next person in the queue.
Officially: "A semaphore restricts the number of simultaneous users of a shared resource up to a
maximum number. Threads can request access to the resource (decrementing the semaphore), and can
signal that they have finished using the resource (incrementing the semaphore)."
Ref: Symbian Developer Library
1. The ownership of a mutex is with the single thread, meaning the same thread which has acquire the
lock can only release it.
whereas in semaphore any other thread or process can release the semaphore taken by a
process/thread
2. If a process locking the semaphore is killed by any chance and another process waiting for the lock to
be released, never gets notified.
Whereas in mutex, if another process is waiting for the lock, and the process acquired mutex got killed,
the kernel informs
3. recursion is not possible with semaphore, meaning locking the same semaphore again by the same
process will lead to deadlock condition.
but mutex recursion can be enabled. By which the same process can acquire the mutex lock any number
of times
4.semaphore doesnt support priority inheritance, so shouldn't be preferred for RTOS
Goood example of semaphore
Answer: b
Explanation: None.
2. Hard real time operating system has ___ jitter than a soft real time operating system.
a) less
b) more
c) equal
d) none of the mentioned
View Answer
Answer: a
Explanation: Jitter is the undesired deviation from the true periodicity.
3. For real time operating systems, interrupt latency should be
a) minimal
b) maximum
c) zero
d) dependent on the scheduling
View Answer
Answer: a
Explanation: Interrupt latency is the time duration between the generation of interrupt and execution of
its service.
4. In rate monotonic scheduling
a) shorter duration job has higher priority
b) longer duration job has higher priority
c) priority does not depend on the duration of the job
d) none of the mentioned
View Answer
Answer: a
Explanation: None.
5. In which scheduling certain amount of CPU time is allocated to each process?
a) earliest deadline first scheduling
b) proportional share scheduling
c) equal share scheduling
d) none of the mentioned
View Answer
Answer: b
Explanation: None.
6. The problem of priority inversion can be solved by
a) priority inheritance protocol
b) priority inversion protocol
c) both priority inheritance and inversion protocol
d) none of the mentioned
View Answer
Answer: a
Explanation: None.
7. Time duration required for scheduling dispatcher to stop one process and start another is known as
a) process latency
b) dispatch latency
c) execution latency
d) interrupt latency
View Answer
Answer: b
Explanation: None.
8. Time required to synchronous switch from the context of one thread to the context of another thread
is called
a) threads fly-back time
b) jitter
c) context switch time
d) none of the mentioned
View Answer
Answer: c
Explanation: None.
9. Which one of the following is a real time operating system?
a) RTLinux
b) VxWorks
c) Windows CE
d) All of the mentioned
View Answer
Answer: d
Explanation: None.
10. VxWorks is centered around
a) wind microkernel
b) linux kernel
c) unix kernel
d) none of the mentioned
View Answer
Answer: a
Explanation: None.
Kindly you can find the Following Useful Embedded materials
For Automotive Protocols
On the internet (not prepared by me)
CAN and LIN bus technology
Introduction:
Network Characteristics:
1. Transmission Medium
Single wire :Up to 50 Kb/s
Two wires differential: Up to 125 Kb/s
Two wires unshielded twisted: pair(UTP) Up to 500 Kb/s
Two wires shielded twisted: pair(STP) Up to 10 Mb/s
Optical fiber Up to 25 Mb/s
2. Line Coding:
Return to Zero (RZ)
With RZ a '0' bit is represented by 0 volts whereas a '1' data bit is
represented by +V volts for half the cycle and 0 volts for the second
half of the cycle.
Non returning to zero (NRZ)
NRZ encoding uses 0 volts for a data bit of '0' and a +V volts for a data
bit of '1'.
3. Data Packetization:
A packet is a basic unit of communication over a digital network.
A packet is also called a datagram, a segment, a block, a cell or a frame
Depending on the type of network.
4. Network Topology
Ring topology
Star topology
Bus topology
5. Transmission Speed
Communication Terminologies
Examples
Multiple slave devices are allowed with individual slave select (chip select)
lines.
2. I2C (Inter-Integrated Circuit)
Half duplex
Multi Master
3. Protocol Orientations
Message Orientation
All receivers receive the message and only the receiver who
Destination orientation
Why LIN?
What is LIN?
LIN (Local Interconnect Network) is a low cost serial communication system for distributed
electronic systems in vehicles. It complements the existing portfolio of automotive multiplex
networks. LIN enables cost-effective communication for smart sensors and actuators where the
bandwidth and versatility of CAN is not required.
CAN is a serial bus protocol to connect individual systems and sensors as an alternative
to conventional multi-wire looms. It allows automotive components to communicate on a
single or dual-wire networked data bus up to 1Mbps
Most motor vehicle CAN networks operate at a bus speed of 250KB/s or 500KB/s,
although systems are available operating at up to 1MHz.
Can used Arbitration : CAN uses the established method known as Carrier Sense,
Multiple Access with Collision Detect (CSMA/CD)
Bit encoding: CAN uses Non Return to Zero (NRZ)
Message Frames: In a CAN system, data is transmitted and received using Message
Frames. Message Frames carry data from a transmitting node to one, or more, receiving
nodes.
LIN CAN
Master Single master Multi master
Bit rate 1: 20 kb/s 1k: 1Mb/s
Configuration UART – SCI – Control Control
Message format 2,4,8 byte data Standard protocol
3 byte control 5 control
Extended protocol
8 control
0-8 data for both
Kindly you can find the Following Useful Embedded materials
For Testing /Validation
On the internet (not prepared by me)
Concepts:
• take one module form these modules assigned by the system engineer.
4.End User - Manuals for the end-user, system administrators and support staff.
5.Marketing - How to market the product and analysis of the market demand.
For V model:
DFD and CFD: CFD is DFD and added events , control itms
STD :state transition Diagram also in level 1 ..this is a control state machine of
Level 1
Requirement management:
1. Requirement feasibility:
o Easiest way for feasibility: ask if there is system found like this or no
o Ask if the needed resources found for this project or not
o Cost
o Ask customer: why , how , when , what
Requirement should be :
1. atomic : y3ny mtksra l as3’ar 7aga
2. Certain don't write statments which convey uncertainity
3. Testable “Measurable” like the availability of the device for example
4. Clear “Not ambiguous”
process: A systematic series of actions directed to some end.
Methodology: System of methods, principles, and rules for regulating a given discipline.
2.Non functional requirement(Quality of Service Design):
Testing
Quality control: usually focuses on ensuring the requirements are being met, the overall
project is focused on the correct objectives, and risk is being managed.
Quality Assurance: is focused on the day to day aspects of a project and is used to
determine if procedures are followed.
Verification:
o Are we building the product right?
o Does the software conform to its specification?
o Includes reviews, inspections, walkthroughs, unit testing and integration testing.
o Main purpose is to detect defects in the artifacts of the system under development.
Validation :
o Are we building the right product?
o Does the software meets the customer requirements?
o Includes program reviews, and acceptance testing
Static verification:
Use sw inspection(checklist) and without execution
Inspection Roles:
Author or owner: The programmer or designer responsible for producing the program or
document. Responsible for fixing defects discovered during the inspection process.
Inspector: Finds errors.
Scribe: Records the results of the inspection meeting.
Chairman: Manages the process and facilitates the inspection. Reports process results to
the Chief moderator.
Chief moderator: Responsible for inspection process improvements, checklist updating,
standards development etc.
Inspection checklist:
Data faults
Are all program variables initialized before their values are used?
Have all constants been named?
Control faults
For each conditional statement, is the condition correct?
If a break is required after each case in case statements, has it been included?
Input/output faults
Are all input/output variables used?
Interface faults
Do all function and method calls have the correct number of parameters?
Do formal and actual parameter types match?
Are the parameters in the right order?
Positive Testing is the process of executing a program or a system with the intent of
making sure that it does everything it is supposed to do.
Negative Testing is the process of executing a program or a system with the intent of
making sure the system does not do anything it is not supposed to do.
Test Case is a collection of input values (test data) and a collection of expected output
values designed to test a specific situation of a running software system or part of a
system.
Testing levels:
1. Big Bang Approach ties all of the system modules together at one shot.
Advantages:
Suitable for small-sized and simple systems with limited number of components
Saves the time of developing drivers and stubs
Suitable when modules have been heavily unit tested
Helps for showing the overall system behavior early
Disadvantages:
Risky for systems with large number of components
Complicates the debugging process
Integration cannot start before all system modules are ready
2. Incremental Top-Down approach, the general modules at the top of the overall logic
path are tested first, using stubs for the called modules, then the called modules are
added using stubs for modules they might call.
Advantages: easier to logically understand and helps for seeing the big picture first.
Disadvantages: in most cases, it defers the bulk of the complex processing until later.
3. Incremental Bottom-Up approach, start off with modules at the lower level and use
driver programs to call them, then replace the drivers with the actual programs and
move up the program hierarchy until all the modules are in place.
Advantages: in most cases, it checks for the bulk of the complex processing at the beginning.
Disadvantages: harder to logically understand and harder to see the big picture until later.
Acceptance testing: testing by users to check that the system satisfies requirements,
sometimes called alpha testing
White – Box testing
o Testing the component based on its internal logical structure
o Uses the code paths and statements to generate Test Cases
o Ignores specifications
o Serves for verification only
o Applicable in unit-test only
Non-functional test aims to measuring the system behavior and performance under loads
and variant conditions.
Performed using specialized tools, usually cannot be held by manual test.
Types of non functional test:
1. Performance Test: evaluate the SUT performance in terms of the following:
Speed, accuracy, resources Consumption
2. Load Test: loading the SUT gradually till the usage approaches the system’s
maximum capacity
3. Stress Test: loading the SUT rapidly till the usage goes beyond the system’s
maximum capacity in an attempt to break down the system
4. Reliability Test: test the stability of the SUT over long time of continuous operation
and under different conditions, “long time” differs from a system to another
5. Robustness Test: test the capability of the SUT to tolerate and over come invalid
inputs and conditions
6. Configuration Test: test the behavior of the SUT under different combinations of the
possible configurations
7. Usability Test: test how friendly the system is to new users, usually uses the Test-as-
you-go technique
Beta Test: actual testing by potential user/customer at the users’ site, the product is
released to a selected group of users
Regression Test: verify that the updates in the SUT to fix a recently reported bug or to
integrate a new feature/component did not negatively impacted the already passing TCs
A Bug is an error or flaw in a computer program that may prevent it from working
correctly or produce an incorrect or unintended result.
A bug is said to be consistent if there is a fixed procedure that reproduces the bug every
time it is executed under the same conditions
A bug is said to be inconsistent if the reproduction procedure does not show the bug
every time it is executed under the same conditions