SlideShare a Scribd company logo
Introduction to State
Machines
About Swift Act LLC
Introduction to State Machine @ Swift Act LLC
❑ Established @ end of 2017
❑ Legal representation in Egypt and Germany
❑ Experience in Automotive, Industrial Automation, IoT, consumer electronics …
❑ Safety critical experience: IEC 61508, ISO 26262 ...
❑ Process compliance: A-SPICE and CMMI
❑ Mission: Long-term partnership with stakeholders
❑ Vision: Maximizing value for stakeholders
❑ Values: Ethics, Empowerment, Professionalism, Team Work and Trust
❑ www.swift-act.com
What is a State Machine?
Introduction to State Machine @ Swift Act LLC
Why a State Machine?
Introduction to State Machine @ Swift Act LLC
State Machines are Hierarchical
Introduction to State Machine @ Swift Act LLC
State Machines are Concurrent
Introduction to State Machine @ Swift Act LLC
State Machine Elements
Introduction to State Machine @ Swift Act LLC
S/M
Elements
States
Transitions
Events
Actions
States are ...
Introduction to State Machine @ Swift Act LLC
States
Finite
Distinct
1 or more
initial states
0 or more
end states
0 or more
intermediate
states
State Machine Graphical Representation
Introduction to State Machine @ Swift Act LLC
Stopped Playing
Paused
Play/Song is Playing from beginning
Stop or Song Finished/Song
is Stopped
Pause/Song is Paused
Play/Song is Resumed
Stop/Song is Stopped
State Machine Tabular Representation
Introduction to State Machine @ Swift Act LLC
Current State Event Action Next State
Stopped Play
Play song from
beginning
Playing
Stopped Pause Stopped
Stopped Stop Stopped
Stopped Song finished Stopped
Playing Play Playing
Playing Pause Song is paused Paused
Playing Stop Song is stopped Stopped
Playing Song finished Song is stopped Stopped
Paused Play Song is resumed Playing
Paused Pause Paused
Paused Stop Song is stopped Stopped
Paused Song finished Paused
State Machine Textual Representation
Introduction to State Machine @ Swift Act LLC
State Machine from Design PoV
Introduction to State Machine @ Swift Act LLC
Events Timing events only?
Input events only?
Timing and input events
State Machine from Coding PoV
Introduction to State Machine @ Swift Act LLC
Function
for
every
state?
Similar? 1 function + Data
Different? State type + State
variable + function
(switch-case) +
function for every
state (optional)
Data-Indexed State Machine Example
Introduction to State Machine @ Swift Act LLC
Data-Indexed State Machine Example cont’d
Introduction to State Machine @ Swift Act LLC
Execution-Indexed State Machine Example
Introduction to State Machine @ Swift Act LLC
Execution-Indexed State Machine Example cont’d
Introduction to State Machine @ Swift Act LLC
Remember: State Machines are Hierarchical
Introduction to State Machine @ Swift Act LLC
Testing State Machine – Coverage Methods
Introduction to State Machine @ Swift Act LLC
• States
• Events
• Actions
• Paths
Testing State Machine – Coverage Methods cont’d
Introduction to State Machine @ Swift Act LLC
• States
• Events
• Actions
• Paths
Testing State Machine – Coverage Methods cont’d
Introduction to State Machine @ Swift Act LLC
• States
• Events
• Actions
• Paths
Testing State Machine – Coverage Methods cont’d
Introduction to State Machine @ Swift Act LLC
• States
• Events
• Actions
• Paths
Transition Coverage: n-switch (+ve Testing)
Introduction to State Machine @ Swift Act LLC
A
B
C
D
F
E
1
2
9
8
10
3
14
11
4
13
5
12
7
6
Transition Coverage: 0-switch vs. 1-switch
Introduction to State Machine @ Swift Act LLC
0-switch 1-switch
A1 A2 A9 A1A1 A1A2 A1A9 A9B10 A9B8 A9B3
B10 B8 B3 B10C14 B10C11 B10C4 B8A1 B8A2 B8A9
C14 C11 C4 C14C14 C14C11 C14C4 C11D13 C11D12 C11D5
D13 D12 D5 D13D13 D13D12 D13D5 D12F6 D12F7
F6 F7 F7A1 F7A2 F7A9
0-switch: Systematic Way
Introduction to State Machine @ Swift Act LLC
1
3
2
4
1
3 4
1212
13
13
12
n-switch: Systematic Way
Introduction to State Machine @ Swift Act LLC
(N-1)-
switch
Extra
level in
the tree
N-
switch
-ve Testing
Introduction to State Machine @ Swift Act LLC
-ve Testing
Testing
Invalid
Transitions
Case Study: Digital Clock
Introduction to State Machine @ Swift Act LLC
Digital ClockSet Button
+ Button
- Button
Hours Units SSD
Minutes Tens SSD
Hours Tens SSD
Minutes Units SSD
Case Study: Block Diagram
Introduction to State Machine @ Swift Act LLC
Digital Clock
SW
Time
SSD
Display
Case Study: SW
Introduction to State Machine @ Swift Act LLC
Case Study: SSD
Introduction to State Machine @ Swift Act LLC
Case Study: Time
Introduction to State Machine @ Swift Act LLC
Set Hours
Set
Minutes
Normal
Set is pressed
Set is pressed
Set is pressed
Case Study: Display
Introduction to State Machine @ Swift Act LLC
Blink
Hours
Blink
Minutes
Blink
Seconds
Time mode = Set Hours
Time mode = Set Minutes
Time mode = Normal
Introduction to State Machine @ Swift Act LLC

More Related Content

What's hot

U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
Emertxe Information Technologies Pvt Ltd
 
RISC-V Online Tutor
RISC-V Online TutorRISC-V Online Tutor
RISC-V Online Tutor
RISC-V International
 
Asynchronous Sequential Circuit-Unit 4 ppt
Asynchronous Sequential Circuit-Unit 4 pptAsynchronous Sequential Circuit-Unit 4 ppt
Asynchronous Sequential Circuit-Unit 4 ppt
SIVALAKSHMIPANNEERSE
 
Lambda design rule
Lambda design ruleLambda design rule
Lambda design rule
Gowri Kishore
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
VLSI Design Sequential circuit design
VLSI Design Sequential circuit designVLSI Design Sequential circuit design
VLSI Design Sequential circuit design
tamil arasan
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
Anil Kumar Pugalia
 
Comparison between the FPGA vs CPLD
Comparison between the FPGA vs CPLDComparison between the FPGA vs CPLD
Comparison between the FPGA vs CPLD
Gowri Kishore
 
Embedded C - Day 2
Embedded C - Day 2Embedded C - Day 2
Timers and pwm
Timers and pwmTimers and pwm
Timers and pwm
Saideep Kamishetty
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
mukul bhardwaj
 
Hardware Software Codesign
Hardware Software CodesignHardware Software Codesign
Hardware Software Codesign
destruck
 
Delay Calculation in CMOS Chips Using Logical Effort by Prof. Akhil Masurkar
Delay Calculation in CMOS Chips Using Logical Effort by Prof. Akhil MasurkarDelay Calculation in CMOS Chips Using Logical Effort by Prof. Akhil Masurkar
Delay Calculation in CMOS Chips Using Logical Effort by Prof. Akhil Masurkar
Akhil Masurkar
 
Finite state machines
Finite state machinesFinite state machines
Finite state machines
dennis gookyi
 
Introduction To Embedded Systems
Introduction To Embedded SystemsIntroduction To Embedded Systems
Introduction To Embedded Systems
Vishwa Mohan
 
I2c drivers
I2c driversI2c drivers
I2c drivers
pradeep_tewani
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
Ankur Soni
 
CMOS Logic
CMOS LogicCMOS Logic
CMOS Logic Circuits
CMOS Logic CircuitsCMOS Logic Circuits
CMOS Logic Circuits
Marmik Kothari
 
ASIC DESIGN FLOW
ASIC DESIGN FLOWASIC DESIGN FLOW
ASIC DESIGN FLOW
Purvi Medawala
 

What's hot (20)

U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
RISC-V Online Tutor
RISC-V Online TutorRISC-V Online Tutor
RISC-V Online Tutor
 
Asynchronous Sequential Circuit-Unit 4 ppt
Asynchronous Sequential Circuit-Unit 4 pptAsynchronous Sequential Circuit-Unit 4 ppt
Asynchronous Sequential Circuit-Unit 4 ppt
 
Lambda design rule
Lambda design ruleLambda design rule
Lambda design rule
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
VLSI Design Sequential circuit design
VLSI Design Sequential circuit designVLSI Design Sequential circuit design
VLSI Design Sequential circuit design
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
 
Comparison between the FPGA vs CPLD
Comparison between the FPGA vs CPLDComparison between the FPGA vs CPLD
Comparison between the FPGA vs CPLD
 
Embedded C - Day 2
Embedded C - Day 2Embedded C - Day 2
Embedded C - Day 2
 
Timers and pwm
Timers and pwmTimers and pwm
Timers and pwm
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Hardware Software Codesign
Hardware Software CodesignHardware Software Codesign
Hardware Software Codesign
 
Delay Calculation in CMOS Chips Using Logical Effort by Prof. Akhil Masurkar
Delay Calculation in CMOS Chips Using Logical Effort by Prof. Akhil MasurkarDelay Calculation in CMOS Chips Using Logical Effort by Prof. Akhil Masurkar
Delay Calculation in CMOS Chips Using Logical Effort by Prof. Akhil Masurkar
 
Finite state machines
Finite state machinesFinite state machines
Finite state machines
 
Introduction To Embedded Systems
Introduction To Embedded SystemsIntroduction To Embedded Systems
Introduction To Embedded Systems
 
I2c drivers
I2c driversI2c drivers
I2c drivers
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
 
CMOS Logic
CMOS LogicCMOS Logic
CMOS Logic
 
CMOS Logic Circuits
CMOS Logic CircuitsCMOS Logic Circuits
CMOS Logic Circuits
 
ASIC DESIGN FLOW
ASIC DESIGN FLOWASIC DESIGN FLOW
ASIC DESIGN FLOW
 

Similar to Introduction to state machines in Embedded Software Design

1120 rao mathew
1120 rao mathew1120 rao mathew
1120 rao mathew
Rising Media, Inc.
 
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
European SharePoint Conference
 
How JIRA Service Desk Saved Twitter's Global Help Desk - Alex Stillings
How JIRA Service Desk Saved Twitter's Global Help Desk - Alex StillingsHow JIRA Service Desk Saved Twitter's Global Help Desk - Alex Stillings
How JIRA Service Desk Saved Twitter's Global Help Desk - Alex Stillings
Atlassian
 
Virtual enterprise synthesys
 Virtual enterprise synthesys Virtual enterprise synthesys
Virtual enterprise synthesys
Victor Romanov
 
Discover finite state machines with gen_statem in Erlang /Elixir
Discover finite state machines with gen_statem in Erlang /ElixirDiscover finite state machines with gen_statem in Erlang /Elixir
Discover finite state machines with gen_statem in Erlang /Elixir
Antoine REYT
 
Introduction to State Machines
Introduction to State MachinesIntroduction to State Machines
Introduction to State Machines
codeofficer
 
Flink Forward Berlin 2018: Amey Chaugule - "Threading Needles in a Haystack: ...
Flink Forward Berlin 2018: Amey Chaugule - "Threading Needles in a Haystack: ...Flink Forward Berlin 2018: Amey Chaugule - "Threading Needles in a Haystack: ...
Flink Forward Berlin 2018: Amey Chaugule - "Threading Needles in a Haystack: ...
Flink Forward
 
Sessionizing Uber Trips in Realtime - Flink Forward '18, Berlin
Sessionizing Uber Trips in Realtime  - Flink Forward '18, BerlinSessionizing Uber Trips in Realtime  - Flink Forward '18, Berlin
Sessionizing Uber Trips in Realtime - Flink Forward '18, Berlin
Amey Chaugule
 
Government Interoperability Framework (Palestine Case) v5
Government Interoperability Framework (Palestine Case) v5Government Interoperability Framework (Palestine Case) v5
Government Interoperability Framework (Palestine Case) v5
jarrar
 
Hands-On Labs: Identifying Application Delivery Performance Problems with CA ...
Hands-On Labs: Identifying Application Delivery Performance Problems with CA ...Hands-On Labs: Identifying Application Delivery Performance Problems with CA ...
Hands-On Labs: Identifying Application Delivery Performance Problems with CA ...
CA Technologies
 
Microsoft Power Automate Questions and Answers
Microsoft Power Automate Questions and AnswersMicrosoft Power Automate Questions and Answers
Microsoft Power Automate Questions and Answers
SFSupport247
 
Complex event processing platform handling millions of users - Krzysztof Zarz...
Complex event processing platform handling millions of users - Krzysztof Zarz...Complex event processing platform handling millions of users - Krzysztof Zarz...
Complex event processing platform handling millions of users - Krzysztof Zarz...
GetInData
 
The Use of Formal Methods on the iFACTS Air Traffic Control Project
The Use of Formal Methods on the iFACTS Air Traffic Control ProjectThe Use of Formal Methods on the iFACTS Air Traffic Control Project
The Use of Formal Methods on the iFACTS Air Traffic Control Project
AdaCore
 
Cim Automation 0909 Xx (Linkedin)
Cim Automation 0909 Xx (Linkedin)Cim Automation 0909 Xx (Linkedin)
Cim Automation 0909 Xx (Linkedin)
JovanZ
 
Unit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programmingUnit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programming
LeahRachael
 
It's a Bird, It's a Plane, It's a Drone...Innovation at CSCMP
It's a Bird, It's a Plane, It's a Drone...Innovation at CSCMPIt's a Bird, It's a Plane, It's a Drone...Innovation at CSCMP
It's a Bird, It's a Plane, It's a Drone...Innovation at CSCMP
Marketing_Kenco
 
How Railinc Ensures The Links In Our Nation's Supply Chain: CA Spectrum and ...
How Railinc Ensures The Links In Our Nation's Supply Chain: CA Spectrum and ...How Railinc Ensures The Links In Our Nation's Supply Chain: CA Spectrum and ...
How Railinc Ensures The Links In Our Nation's Supply Chain: CA Spectrum and ...
CA Technologies
 
Peering Talk 101 by Douglas Wilson
Peering Talk 101 by Douglas WilsonPeering Talk 101 by Douglas Wilson
Peering Talk 101 by Douglas Wilson
MyNOG
 
Deep Parameters Tuning for Android Mobile Apps
Deep Parameters Tuning for Android Mobile AppsDeep Parameters Tuning for Android Mobile Apps
Deep Parameters Tuning for Android Mobile Apps
Davide De Chiara
 
Instruments control and automation test
Instruments control and automation testInstruments control and automation test
Instruments control and automation test
Paul Dao
 

Similar to Introduction to state machines in Embedded Software Design (20)

1120 rao mathew
1120 rao mathew1120 rao mathew
1120 rao mathew
 
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
State Machine Workflow: Esoteric Techniques & Patterns Everyone Should Buy pr...
 
How JIRA Service Desk Saved Twitter's Global Help Desk - Alex Stillings
How JIRA Service Desk Saved Twitter's Global Help Desk - Alex StillingsHow JIRA Service Desk Saved Twitter's Global Help Desk - Alex Stillings
How JIRA Service Desk Saved Twitter's Global Help Desk - Alex Stillings
 
Virtual enterprise synthesys
 Virtual enterprise synthesys Virtual enterprise synthesys
Virtual enterprise synthesys
 
Discover finite state machines with gen_statem in Erlang /Elixir
Discover finite state machines with gen_statem in Erlang /ElixirDiscover finite state machines with gen_statem in Erlang /Elixir
Discover finite state machines with gen_statem in Erlang /Elixir
 
Introduction to State Machines
Introduction to State MachinesIntroduction to State Machines
Introduction to State Machines
 
Flink Forward Berlin 2018: Amey Chaugule - "Threading Needles in a Haystack: ...
Flink Forward Berlin 2018: Amey Chaugule - "Threading Needles in a Haystack: ...Flink Forward Berlin 2018: Amey Chaugule - "Threading Needles in a Haystack: ...
Flink Forward Berlin 2018: Amey Chaugule - "Threading Needles in a Haystack: ...
 
Sessionizing Uber Trips in Realtime - Flink Forward '18, Berlin
Sessionizing Uber Trips in Realtime  - Flink Forward '18, BerlinSessionizing Uber Trips in Realtime  - Flink Forward '18, Berlin
Sessionizing Uber Trips in Realtime - Flink Forward '18, Berlin
 
Government Interoperability Framework (Palestine Case) v5
Government Interoperability Framework (Palestine Case) v5Government Interoperability Framework (Palestine Case) v5
Government Interoperability Framework (Palestine Case) v5
 
Hands-On Labs: Identifying Application Delivery Performance Problems with CA ...
Hands-On Labs: Identifying Application Delivery Performance Problems with CA ...Hands-On Labs: Identifying Application Delivery Performance Problems with CA ...
Hands-On Labs: Identifying Application Delivery Performance Problems with CA ...
 
Microsoft Power Automate Questions and Answers
Microsoft Power Automate Questions and AnswersMicrosoft Power Automate Questions and Answers
Microsoft Power Automate Questions and Answers
 
Complex event processing platform handling millions of users - Krzysztof Zarz...
Complex event processing platform handling millions of users - Krzysztof Zarz...Complex event processing platform handling millions of users - Krzysztof Zarz...
Complex event processing platform handling millions of users - Krzysztof Zarz...
 
The Use of Formal Methods on the iFACTS Air Traffic Control Project
The Use of Formal Methods on the iFACTS Air Traffic Control ProjectThe Use of Formal Methods on the iFACTS Air Traffic Control Project
The Use of Formal Methods on the iFACTS Air Traffic Control Project
 
Cim Automation 0909 Xx (Linkedin)
Cim Automation 0909 Xx (Linkedin)Cim Automation 0909 Xx (Linkedin)
Cim Automation 0909 Xx (Linkedin)
 
Unit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programmingUnit 4- State Machine in mobile programming
Unit 4- State Machine in mobile programming
 
It's a Bird, It's a Plane, It's a Drone...Innovation at CSCMP
It's a Bird, It's a Plane, It's a Drone...Innovation at CSCMPIt's a Bird, It's a Plane, It's a Drone...Innovation at CSCMP
It's a Bird, It's a Plane, It's a Drone...Innovation at CSCMP
 
How Railinc Ensures The Links In Our Nation's Supply Chain: CA Spectrum and ...
How Railinc Ensures The Links In Our Nation's Supply Chain: CA Spectrum and ...How Railinc Ensures The Links In Our Nation's Supply Chain: CA Spectrum and ...
How Railinc Ensures The Links In Our Nation's Supply Chain: CA Spectrum and ...
 
Peering Talk 101 by Douglas Wilson
Peering Talk 101 by Douglas WilsonPeering Talk 101 by Douglas Wilson
Peering Talk 101 by Douglas Wilson
 
Deep Parameters Tuning for Android Mobile Apps
Deep Parameters Tuning for Android Mobile AppsDeep Parameters Tuning for Android Mobile Apps
Deep Parameters Tuning for Android Mobile Apps
 
Instruments control and automation test
Instruments control and automation testInstruments control and automation test
Instruments control and automation test
 

More from Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)

Embedded SW Testing
Embedded SW TestingEmbedded SW Testing
Cracking the interview
Cracking the interviewCracking the interview
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Embedded summer camps 2017
Embedded summer camps 2017Embedded summer camps 2017
Introduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical ApproachIntroduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical Approach
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
ISTQB Advanced Test Manager Training 2012 - Testing Process
ISTQB Advanced Test Manager Training 2012 - Testing Process ISTQB Advanced Test Manager Training 2012 - Testing Process
ISTQB Advanced Test Manager Training 2012 - Testing Process
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
ISTQB Foundation Agile Tester 2014 Training, Agile SW DevelopmentISTQB Foundation Agile Tester 2014 Training, Agile SW Development
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
ISTQB Technical Test Analyst 2012 Training - Structure-Based TestingISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Simulation Using Isim
Simulation Using Isim Simulation Using Isim
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
Introduction to stm32-part1
Introduction to stm32-part1Introduction to stm32-part1
Introduction to stm32-part2
Introduction to stm32-part2Introduction to stm32-part2
Fpga programming
Fpga programmingFpga programming
Synthesis Using ISE
Synthesis Using ISESynthesis Using ISE
Simulation using model sim
Simulation using model simSimulation using model sim
FreeRTOS Course - Semaphore/Mutex Management
FreeRTOS Course - Semaphore/Mutex ManagementFreeRTOS Course - Semaphore/Mutex Management
FreeRTOS Course - Semaphore/Mutex Management
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 

More from Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation) (20)

Embedded SW Testing
Embedded SW TestingEmbedded SW Testing
Embedded SW Testing
 
Cracking the interview
Cracking the interviewCracking the interview
Cracking the interview
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
Embedded summer camps 2017
Embedded summer camps 2017Embedded summer camps 2017
Embedded summer camps 2017
 
Introduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical ApproachIntroduction to Embedded Systems a Practical Approach
Introduction to Embedded Systems a Practical Approach
 
ISTQB Advanced Test Manager Training 2012 - Testing Process
ISTQB Advanced Test Manager Training 2012 - Testing Process ISTQB Advanced Test Manager Training 2012 - Testing Process
ISTQB Advanced Test Manager Training 2012 - Testing Process
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
 
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
ISTQB Foundation Agile Tester 2014 Training, Agile SW DevelopmentISTQB Foundation Agile Tester 2014 Training, Agile SW Development
ISTQB Foundation Agile Tester 2014 Training, Agile SW Development
 
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
ISTQB Technical Test Analyst 2012 Training - Structure-Based TestingISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
ISTQB Technical Test Analyst 2012 Training - Structure-Based Testing
 
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
ISTQB Technical Test Analyst 2012 Training - The Technical Test Analyst's Tas...
 
Android Booting Scenarios
Android Booting ScenariosAndroid Booting Scenarios
Android Booting Scenarios
 
Simulation Using Isim
Simulation Using Isim Simulation Using Isim
Simulation Using Isim
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Introduction to embedded systems
Introduction to embedded systemsIntroduction to embedded systems
Introduction to embedded systems
 
Introduction to stm32-part1
Introduction to stm32-part1Introduction to stm32-part1
Introduction to stm32-part1
 
Introduction to stm32-part2
Introduction to stm32-part2Introduction to stm32-part2
Introduction to stm32-part2
 
Fpga programming
Fpga programmingFpga programming
Fpga programming
 
Synthesis Using ISE
Synthesis Using ISESynthesis Using ISE
Synthesis Using ISE
 
Simulation using model sim
Simulation using model simSimulation using model sim
Simulation using model sim
 
FreeRTOS Course - Semaphore/Mutex Management
FreeRTOS Course - Semaphore/Mutex ManagementFreeRTOS Course - Semaphore/Mutex Management
FreeRTOS Course - Semaphore/Mutex Management
 

Recently uploaded

Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
FilipTomaszewski5
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
UiPathCommunity
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
BibashShahi
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
Mydbops
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
DianaGray10
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
Fwdays
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
Neo4j
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
LizaNolte
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
Ivo Velitchkov
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
Fwdays
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 

Recently uploaded (20)

Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeckPoznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
Poznań ACE event - 19.06.2024 Team 24 Wrapup slidedeck
 
Day 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio FundamentalsDay 2 - Intro to UiPath Studio Fundamentals
Day 2 - Intro to UiPath Studio Fundamentals
 
Principle of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptxPrinciple of conventional tomography-Bibash Shahi ppt..pptx
Principle of conventional tomography-Bibash Shahi ppt..pptx
 
Must Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during MigrationMust Know Postgres Extension for DBA and Developer during Migration
Must Know Postgres Extension for DBA and Developer during Migration
 
What is an RPA CoE? Session 2 – CoE Roles
What is an RPA CoE?  Session 2 – CoE RolesWhat is an RPA CoE?  Session 2 – CoE Roles
What is an RPA CoE? Session 2 – CoE Roles
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin..."$10 thousand per minute of downtime: architecture, queues, streaming and fin...
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...
 
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge GraphGraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
GraphRAG for LifeSciences Hands-On with the Clinical Knowledge Graph
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham HillinQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
inQuba Webinar Mastering Customer Journey Management with Dr Graham Hill
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024Northern Engraving | Nameplate Manufacturing Process - 2024
Northern Engraving | Nameplate Manufacturing Process - 2024
 
Apps Break Data
Apps Break DataApps Break Data
Apps Break Data
 
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
"Scaling RAG Applications to serve millions of users",  Kevin Goedecke"Scaling RAG Applications to serve millions of users",  Kevin Goedecke
"Scaling RAG Applications to serve millions of users", Kevin Goedecke
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 

Introduction to state machines in Embedded Software Design

  • 2. About Swift Act LLC Introduction to State Machine @ Swift Act LLC ❑ Established @ end of 2017 ❑ Legal representation in Egypt and Germany ❑ Experience in Automotive, Industrial Automation, IoT, consumer electronics … ❑ Safety critical experience: IEC 61508, ISO 26262 ... ❑ Process compliance: A-SPICE and CMMI ❑ Mission: Long-term partnership with stakeholders ❑ Vision: Maximizing value for stakeholders ❑ Values: Ethics, Empowerment, Professionalism, Team Work and Trust ❑ www.swift-act.com
  • 3. What is a State Machine? Introduction to State Machine @ Swift Act LLC
  • 4. Why a State Machine? Introduction to State Machine @ Swift Act LLC
  • 5. State Machines are Hierarchical Introduction to State Machine @ Swift Act LLC
  • 6. State Machines are Concurrent Introduction to State Machine @ Swift Act LLC
  • 7. State Machine Elements Introduction to State Machine @ Swift Act LLC S/M Elements States Transitions Events Actions
  • 8. States are ... Introduction to State Machine @ Swift Act LLC States Finite Distinct 1 or more initial states 0 or more end states 0 or more intermediate states
  • 9. State Machine Graphical Representation Introduction to State Machine @ Swift Act LLC Stopped Playing Paused Play/Song is Playing from beginning Stop or Song Finished/Song is Stopped Pause/Song is Paused Play/Song is Resumed Stop/Song is Stopped
  • 10. State Machine Tabular Representation Introduction to State Machine @ Swift Act LLC Current State Event Action Next State Stopped Play Play song from beginning Playing Stopped Pause Stopped Stopped Stop Stopped Stopped Song finished Stopped Playing Play Playing Playing Pause Song is paused Paused Playing Stop Song is stopped Stopped Playing Song finished Song is stopped Stopped Paused Play Song is resumed Playing Paused Pause Paused Paused Stop Song is stopped Stopped Paused Song finished Paused
  • 11. State Machine Textual Representation Introduction to State Machine @ Swift Act LLC
  • 12. State Machine from Design PoV Introduction to State Machine @ Swift Act LLC Events Timing events only? Input events only? Timing and input events
  • 13. State Machine from Coding PoV Introduction to State Machine @ Swift Act LLC Function for every state? Similar? 1 function + Data Different? State type + State variable + function (switch-case) + function for every state (optional)
  • 14. Data-Indexed State Machine Example Introduction to State Machine @ Swift Act LLC
  • 15. Data-Indexed State Machine Example cont’d Introduction to State Machine @ Swift Act LLC
  • 16. Execution-Indexed State Machine Example Introduction to State Machine @ Swift Act LLC
  • 17. Execution-Indexed State Machine Example cont’d Introduction to State Machine @ Swift Act LLC
  • 18. Remember: State Machines are Hierarchical Introduction to State Machine @ Swift Act LLC
  • 19. Testing State Machine – Coverage Methods Introduction to State Machine @ Swift Act LLC • States • Events • Actions • Paths
  • 20. Testing State Machine – Coverage Methods cont’d Introduction to State Machine @ Swift Act LLC • States • Events • Actions • Paths
  • 21. Testing State Machine – Coverage Methods cont’d Introduction to State Machine @ Swift Act LLC • States • Events • Actions • Paths
  • 22. Testing State Machine – Coverage Methods cont’d Introduction to State Machine @ Swift Act LLC • States • Events • Actions • Paths
  • 23. Transition Coverage: n-switch (+ve Testing) Introduction to State Machine @ Swift Act LLC A B C D F E 1 2 9 8 10 3 14 11 4 13 5 12 7 6
  • 24. Transition Coverage: 0-switch vs. 1-switch Introduction to State Machine @ Swift Act LLC 0-switch 1-switch A1 A2 A9 A1A1 A1A2 A1A9 A9B10 A9B8 A9B3 B10 B8 B3 B10C14 B10C11 B10C4 B8A1 B8A2 B8A9 C14 C11 C4 C14C14 C14C11 C14C4 C11D13 C11D12 C11D5 D13 D12 D5 D13D13 D13D12 D13D5 D12F6 D12F7 F6 F7 F7A1 F7A2 F7A9
  • 25. 0-switch: Systematic Way Introduction to State Machine @ Swift Act LLC 1 3 2 4 1 3 4 1212 13 13 12
  • 26. n-switch: Systematic Way Introduction to State Machine @ Swift Act LLC (N-1)- switch Extra level in the tree N- switch
  • 27. -ve Testing Introduction to State Machine @ Swift Act LLC -ve Testing Testing Invalid Transitions
  • 28. Case Study: Digital Clock Introduction to State Machine @ Swift Act LLC Digital ClockSet Button + Button - Button Hours Units SSD Minutes Tens SSD Hours Tens SSD Minutes Units SSD
  • 29. Case Study: Block Diagram Introduction to State Machine @ Swift Act LLC Digital Clock SW Time SSD Display
  • 30. Case Study: SW Introduction to State Machine @ Swift Act LLC
  • 31. Case Study: SSD Introduction to State Machine @ Swift Act LLC
  • 32. Case Study: Time Introduction to State Machine @ Swift Act LLC Set Hours Set Minutes Normal Set is pressed Set is pressed Set is pressed
  • 33. Case Study: Display Introduction to State Machine @ Swift Act LLC Blink Hours Blink Minutes Blink Seconds Time mode = Set Hours Time mode = Set Minutes Time mode = Normal
  • 34. Introduction to State Machine @ Swift Act LLC