SlideShare a Scribd company logo
1 of 34
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

Tdd with python unittest for embedded c
Tdd with python unittest for embedded cTdd with python unittest for embedded c
Tdd with python unittest for embedded cBenux Wei
 
AUTOSAR 403 CAN Stack
AUTOSAR 403 CAN StackAUTOSAR 403 CAN Stack
AUTOSAR 403 CAN StackRania Nabil
 
Arm modes
Arm modesArm modes
Arm modesabhi165
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsHariharan Ganesan
 
Automotive Ethernet: Physical Layer Compliance Testing Webinar Slides
Automotive Ethernet: Physical Layer Compliance Testing Webinar SlidesAutomotive Ethernet: Physical Layer Compliance Testing Webinar Slides
Automotive Ethernet: Physical Layer Compliance Testing Webinar Slidesteledynelecroy
 
Understanding Flash Bootloader Software and Automotive ECU Reprogramming
Understanding Flash Bootloader Software and Automotive ECU ReprogrammingUnderstanding Flash Bootloader Software and Automotive ECU Reprogramming
Understanding Flash Bootloader Software and Automotive ECU ReprogrammingEmbitel Technologies (I) PVT LTD
 
Autosar basics by ARCCORE
Autosar basics by ARCCOREAutosar basics by ARCCORE
Autosar basics by ARCCOREARCCORE
 
Embedded system design process
Embedded system design processEmbedded system design process
Embedded system design processRayees CK
 
Autosar-software-component_0hg.pptx
Autosar-software-component_0hg.pptxAutosar-software-component_0hg.pptx
Autosar-software-component_0hg.pptxfallleaf1104
 
PLC power point presentation
PLC power point presentationPLC power point presentation
PLC power point presentationNaga Teja
 

What's hot (20)

Osek turbo
Osek turboOsek turbo
Osek turbo
 
Embedded C - Lecture 1
Embedded C - Lecture 1Embedded C - Lecture 1
Embedded C - Lecture 1
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Tdd with python unittest for embedded c
Tdd with python unittest for embedded cTdd with python unittest for embedded c
Tdd with python unittest for embedded c
 
Embedded SW Testing
Embedded SW TestingEmbedded SW Testing
Embedded SW Testing
 
Embedded C - Day 1
Embedded C - Day 1Embedded C - Day 1
Embedded C - Day 1
 
AUTOSAR 403 CAN Stack
AUTOSAR 403 CAN StackAUTOSAR 403 CAN Stack
AUTOSAR 403 CAN Stack
 
Arm modes
Arm modesArm modes
Arm modes
 
Allen bradley
Allen bradleyAllen bradley
Allen bradley
 
Real Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systemsReal Time Operating system (RTOS) - Embedded systems
Real Time Operating system (RTOS) - Embedded systems
 
Automotive Ethernet: Physical Layer Compliance Testing Webinar Slides
Automotive Ethernet: Physical Layer Compliance Testing Webinar SlidesAutomotive Ethernet: Physical Layer Compliance Testing Webinar Slides
Automotive Ethernet: Physical Layer Compliance Testing Webinar Slides
 
Understanding Flash Bootloader Software and Automotive ECU Reprogramming
Understanding Flash Bootloader Software and Automotive ECU ReprogrammingUnderstanding Flash Bootloader Software and Automotive ECU Reprogramming
Understanding Flash Bootloader Software and Automotive ECU Reprogramming
 
Autosar basics by ARCCORE
Autosar basics by ARCCOREAutosar basics by ARCCORE
Autosar basics by ARCCORE
 
Embedded C - Day 2
Embedded C - Day 2Embedded C - Day 2
Embedded C - Day 2
 
Embedded system design process
Embedded system design processEmbedded system design process
Embedded system design process
 
Unit I Testing
Unit I TestingUnit I Testing
Unit I Testing
 
Autosar-software-component_0hg.pptx
Autosar-software-component_0hg.pptxAutosar-software-component_0hg.pptx
Autosar-software-component_0hg.pptx
 
Hardware in loop simulation
Hardware in loop simulationHardware in loop simulation
Hardware in loop simulation
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
PLC power point presentation
PLC power point presentationPLC power point presentation
PLC power point presentation
 

Similar to Introduction to state machines in Embedded Software Design

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 StillingsAtlassian
 
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 /ElixirAntoine REYT
 
Introduction to State Machines
Introduction to State MachinesIntroduction to State Machines
Introduction to State Machinescodeofficer
 
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, BerlinAmey Chaugule
 
Government Interoperability Framework (Palestine Case) v5
Government Interoperability Framework (Palestine Case) v5Government Interoperability Framework (Palestine Case) v5
Government Interoperability Framework (Palestine Case) v5jarrar
 
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
 
Agile + DevOps Keynote - The Evolution of a Continuous Integration Pipeline
Agile + DevOps Keynote - The Evolution of a Continuous Integration PipelineAgile + DevOps Keynote - The Evolution of a Continuous Integration Pipeline
Agile + DevOps Keynote - The Evolution of a Continuous Integration PipelineGreg Sypolt
 
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 ProjectAdaCore
 
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 programmingLeahRachael
 
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 CSCMPMarketing_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
 
Vasyl Sydorivskiy - Angular Functional Style
Vasyl Sydorivskiy - Angular Functional StyleVasyl Sydorivskiy - Angular Functional Style
Vasyl Sydorivskiy - Angular Functional StyleInnovecs
 
Peering Talk 101 by Douglas Wilson
Peering Talk 101 by Douglas WilsonPeering Talk 101 by Douglas Wilson
Peering Talk 101 by Douglas WilsonMyNOG
 
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 AppsDavide De Chiara
 
Instruments control and automation test
Instruments control and automation testInstruments control and automation test
Instruments control and automation testPaul Dao
 
Marton Balassi – Stateful Stream Processing
Marton Balassi – Stateful Stream ProcessingMarton Balassi – Stateful Stream Processing
Marton Balassi – Stateful Stream ProcessingFlink Forward
 

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
 
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 ...
 
Agile + DevOps Keynote - The Evolution of a Continuous Integration Pipeline
Agile + DevOps Keynote - The Evolution of a Continuous Integration PipelineAgile + DevOps Keynote - The Evolution of a Continuous Integration Pipeline
Agile + DevOps Keynote - The Evolution of a Continuous Integration Pipeline
 
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 ...
 
Vasyl Sydorivskiy - Angular Functional Style
Vasyl Sydorivskiy - Angular Functional StyleVasyl Sydorivskiy - Angular Functional Style
Vasyl Sydorivskiy - Angular Functional Style
 
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
 
Marton Balassi – Stateful Stream Processing
Marton Balassi – Stateful Stream ProcessingMarton Balassi – Stateful Stream Processing
Marton Balassi – Stateful Stream Processing
 

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

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

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
 
FreeRTOS Course - Queue Management
FreeRTOS Course - Queue ManagementFreeRTOS Course - Queue Management
FreeRTOS Course - Queue Management
 

Recently uploaded

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

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