FSM: a computational model that is in exactly one of a finite number of states at a time and moves between them in response to events according to explicit transition rules. It makes valid behavior explicit.
2 / 5
What is a key benefit of modeling UI logic as a state machine?
Impossible states: by enumerating allowed states and transitions, you cannot reach contradictory combinations (e.g., loading and error simultaneously). This prevents a whole class of UI bugs.
3 / 5
What does a transition consist of in a state machine?
Transition: defines that when in a given state and a specific event occurs, the machine moves to a new state, optionally gated by a guard condition and triggering side-effect actions.
4 / 5
What distinguishes a statechart (Harel) from a basic FSM?
Statechart: extends FSMs with nested (hierarchical) states, parallel (orthogonal) regions, and history states, taming the state explosion problem and modeling complex behavior compactly.
5 / 5
What is a guard in a state transition?
Guard: a predicate evaluated when an event occurs; the transition only proceeds if the guard is true. Guards let the same event lead to different outcomes based on context.