Week 6: State Machines

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/18

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

What is a state machine?

A behavior model capturing the dynamic behavior of an object in terms of states, events, and transitions.

2
New cards

In UML state machine diagrams, what is a state?

The condition of an object at a particular moment in time.

3
New cards

In UML state machine diagrams, what is an event?

A noteworthy occurrence that can trigger a state transition.

4
New cards

In UML state machine diagrams, what is a transition?

A directed relationship between states representing a change triggered by an event.

5
New cards

How is the initial state represented in a UML state machine diagram?

With a filled black circle.

6
New cards

What is the general format for a transition label in UML state machine diagrams?

trigger [guard] / action.

7
New cards

What is a guard in a state machine transition?

A precondition that must be true for the transition to occur.

8
New cards

What is a transition action in a state machine diagram?

An action executed when the transition occurs, such as invoking a method.

9
New cards

What types of objects are suitable for modeling with state machines?

State-dependent objects whose behavior varies based on their state, especially with complex reactive behavior.

10
New cards

According to the lecture, in which domains are state machines most commonly applied?

Communications and control applications, device controllers, UI flows, and protocols; less common in simple business information systems.

11
New cards

What is a nested state in a UML state machine?

A state containing substates, allowing hierarchical modeling where substates inherit superstate transitions.

12
New cards

How do nested states help manage state-dependent behavior?

They encapsulate behaviors that only apply when the system is within a particular superstate.

13
New cards

What is a choice pseudostate?

A diamond symbol representing a dynamic conditional branch, selecting one outgoing transition based on guard conditions.

14
New cards

What purpose does the [else] guard serve in a choice pseudostate?

To define the default transition when no other guard conditions are met.

15
New cards

How can time-triggered events be represented in state machines?

As a trigger on a transition, e.g., 'Timer reaches 30 seconds'.

16
New cards

In the pedestrian crossing light example, what triggers the transition from Red Standing to Green Walking?

The pedestrian presses the crossing button when the traffic light is Red.

17
New cards

In the telephone state machine example, what event transitions the phone from Idle to Active?

Picking up the receiver.

18
New cards

In the iPhone state machine example, what event toggles the phone between Sleep and Awake states?

Pressing the side button.

19
New cards

When might you choose a state machine diagram over a sequence diagram?

When object behavior is highly state-dependent and a sequence diagram would become overly complex.