State Machine Diagrams Flashcards

(20 cards)

1
Q

What is a state machine diagram?

A

A diagram showing how an object changes states (like ‘on/off’) in response to events.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two main parts of a state machine?

A
  1. States (boxes) 2. Transitions (arrows between boxes).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a ‘state’?

A

A condition an object is in (e.g., ‘Idle’, ‘Processing’, ‘Error’).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three special state activities?

A

entry/ (runs on entering), exit/ (runs on exiting), do/ (runs while in state).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What triggers a transition?

A

An event (e.g., button press, timeout) + optional guard condition.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What’s the difference between internal and external transitions?

A

Internal: Stay in same state (run actions). External: Move to new state (run exit/actions/entry).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the 4 event types?

A
  1. Signal (e.g., ‘mouseClick’) 2. Call (e.g., ‘register()’) 3. Time (‘after(5s)’) 4. Change (‘when(x>y)’).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a guard?

A

A condition in [brackets] that must be true for transition (e.g., ‘[balance>0]’).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What’s the initial state?

A

A black circle (●) showing where the machine starts. Not a real state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What’s the final state?

A

A bullseye (⭘) where the machine ends. Object stays here forever.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What’s a terminate node?

A

A cross (✖) that deletes the object (unlike final state).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does a decision node look like?

A

A diamond (◇) splitting paths based on guards (like ‘if/else’).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are parallelization/synchronization nodes?

A

Solid bars (━) splitting/merging concurrent flows (like forks in activity diagrams).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How is time modeled?

A

With time events: ‘after(10min)’ (relative) or ‘when(time=12:00)’ (absolute).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What’s a ‘change event’?

A

Continuously checks a condition (e.g., ‘when(temperature>100)’).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What’s an example state machine?

A

Traffic light: Red → (timer) → Green → (timer) → Yellow → Red.

17
Q

Why use state machines?

A

To clearly show complex object behavior (e.g., login: ‘Entering → Validating → Success/Fail’).

18
Q

What’s a pseudostate?

A

A temporary control point (e.g., initial state, decision node).

19
Q

How to show actions during transition?

A

On transition arrow: ‘event [guard] / action()’.

20
Q

What’s a ‘completion event’?

A

Automatic transition when state’s ‘do/’ activity finishes.