FSM tests
Finite State Machines
Below different formats to document automatically a finite state machine description.
The nicest diagrams are often produced through PlantUML. Sometimes you must tinker with the declaration order of the state to improve the layout result.
Finite State Machine bbv
fsm-bbv States
| Name | Context | Description | Final | Initial | Composite | Entry Action | Exit Action |
|---|---|---|---|---|---|---|---|
- |
true |
true |
true |
- |
- |
||
Root |
false |
true |
false |
Entry action of Off state |
ExitOffstate |
||
Root |
false |
false |
false |
||||
Root |
false |
false |
true |
||||
On |
false |
false |
true |
entryFM |
exitFM |
||
On |
false |
true |
false |
||||
FM |
false |
true |
false |
entryPlay |
exitPlay |
||
FM |
false |
false |
false |
fsm-bbv Transitions
| Start State | End State | Description | Local | Guard | Action |
|---|---|---|---|---|---|
Off → TogglePower |
false |
Maintenance is On |
log transition Off to Maintenance |
||
Off → On |
false |
Maintenance Off |
OfftoOn |
||
Maintenance → Off |
false |
MaintainedtoOff |
|||
TogglePower → On |
false |
OntoOff |
|||
FM → DAB |
false |
FMtoDAB |
|||
DAB → DAB |
true |
||||
DAB → FM |
false |
DABtoFM |
|||
Play → Play |
true |
||||
Play → AutoTune |
false |
PlaytoAutoTune |
|||
AutoTune → Play |
false |
AutoTunetoPlay |
Graphical Representation with dot
Graphical Representation with PlantUml
Graphical Representation with mermaid
Graphical Representation with State Machine Cat
Finite State Machine Test
Below different formats to document automatically a finite state machine description.
fsm-test States
| Name | Context | Description | Final | Initial | Composite | Entry Action | Exit Action |
|---|---|---|---|---|---|---|---|
- |
true |
true |
true |
- |
- |
||
Root |
State A |
false |
true |
true |
- |
- |
|
A |
State AA |
false |
true |
false |
- |
- |
|
A |
State AB |
false |
false |
false |
- |
- |
|
Root |
false |
false |
true |
- |
- |
||
B |
State BA |
false |
false |
false |
- |
- |
|
B |
State BB |
false |
true |
false |
- |
- |
|
Root |
true |
false |
false |
- |
- |
fsm-test Transitions
| Start State | End State | Description | Local | Guard | Action |
|---|---|---|---|---|---|
A → C when A_C |
false |
||||
Local transition AA → AA when (AA_AA) |
true |
||||
AA → AB when AA_AB |
false |
||||
AA → B when AA_B |
false |
||||
AA → BB when (AA_BB) |
false |
||||
AB → AA when AB_AA |
false |
||||
AB → AB when AB_AB |
false |
||||
B → C when B_C |
false |
||||
BA → A when BA_C |
false |
||||
BA → BB when BA_BB |
false |
||||
Local transition BB → BB when BB_BB |
true |
||||
false |
VV → BA when BB_BA |
||||
BB → C when BB_C |
false |
Graphical Representation with dot
Graphical Representation with PlantUml
Graphical Representation with mermaid
Graphical Representation with State Machine Cat
Finite State Machine Washer
Below different formats to document automatically a finite state machine description.
fsm-washer States
| Name | Context | Description | Final | Initial | Composite | Entry Action | Exit Action |
|---|---|---|---|---|---|---|---|
- |
true |
true |
true |
- |
- |
||
Root |
Running State |
false |
true |
true |
- |
- |
|
Root |
State End |
true |
false |
false |
- |
- |
|
Running |
Washing State |
false |
true |
false |
- |
- |
|
Running |
Rising State |
false |
false |
false |
- |
- |
|
Running |
Drying State |
true |
false |
false |
- |
- |
|
Root |
PowerOff State |
false |
false |
false |
- |
- |
fsm-washer Transitions
| Start State | End State | Description | Local | Guard | Action |
|---|---|---|---|---|---|
Running → End |
false |
||||
Running → PowerOff |
false |
||||
Washing → Rinsing |
false |
||||
Rinsing → Drying |
false |
||||
PowerOff → Running |
false |