UPI Study › Courses › Software Engineering › Free lessons › Lesson 7.3 Free with a free account
Modeling How Systems Behave Under Different Conditions
Software Engineering · Chapter 7: Behavioral Models and Requirements AnalysisSection 7.3 · lesson 49 of 1036 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Software Engineering.
Lesson complete
Earn the 3 college credits for Software Engineering
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Breaking Down Requirements: Classes, Functions, and Behaviors →← Defining System Boundaries with Context DiagramsNext lesson: Breaking Down Requirements: Classes, Functions, and Behaviors →
In this lesson
States, events, transitions - and why the same event can mean different things.
- Define a state, and why responses depend on it
- Distinguish an event from a transition
- Read a state diagram, with its initial marker and transitions
- Explain why a missing transition is meaningful
Transcript
Everything said in the video, section by section (887 words). Read along, or search it.
Behavioral Models and Requirements Analysis
Modeling How Systems Behave Under Different Conditions
Why does pressing the same button on a media player sometimes start playback, and sometimes do nothing at all? Because systems do not respond to events in a vacuum. This section covers state diagrams. How they model a system's response to events over time, and why what they leave out matters too.
Beyond Data
Same Button, Different Result
Data modeling answers what a system's information looks like. An order, its attributes, and its relationships. But it says nothing about what actually happens to that order over time. The very same event can produce completely different results, depending on what has already happened. Behavioral modeling, through state diagrams, is how that condition-dependent behavior gets captured and checked, before it is built. It models one system, or one object, responding to events. The step-by-step interaction between separate objects is a separate topic.
States
A Distinct Condition
A state is a distinct condition a system, or a single object in it, can be in at a given moment. While it is in that state, it behaves in a particular, consistent way. A media player is stopped, playing, or paused. An order is placed, shipped, delivered, or canceled. And while a system sits in one state, the same outside event can produce a different result than it would in another state. That is the core insight. Behavior depends on the event, combined with the state the system was already in.
Events and Transitions
What Happens, and What It Triggers
An event is something that happens that a system can respond to. It might be a user pressing play, a signal from another system, a timer expiring, or an operation completing. A transition is the move from one state to another that an event can trigger. But not every event triggers a transition from every state. An event that means something in one state may be entirely undefined, or simply ignored, in another.
Figure 7.3A
A Media Player's States
Here is a media player modeled as a state diagram. The filled dot marks the initial state. Before anything happens, the player is stopped. Pressing play moves it from stopped to playing. From playing, pause moves it to paused, and stop returns it to stopped. From paused, play moves it back to playing, and stop returns it to stopped. And notice what is missing. There is no pause transition from stopped. Pausing a stopped player simply means nothing.
Reading Figure 7.3A
"Play" Appears Twice
Look at where play appears. It shows up twice, on two different transitions. From stopped, play starts playback from the beginning. From paused, play resumes playback exactly where it left off. The event is identical. The outcome depends entirely on the state it was triggered from.
Figure 7.3B
An Order's Lifecycle
Here is a second example, the order entity from data modeling, now given a lifecycle. An order starts out placed. From placed, ship moves it to shipped, and cancel moves it to canceled. From shipped, deliver moves it to delivered, and cancel still moves it to canceled. But from delivered, there is no cancel transition at all. An order can be canceled while placed or shipped, but deliberately not once it has been delivered.
What's Left Out
A Missing Transition Is Information
A state diagram is just as informative for what it does not show. If no transition connects a given state to a given event, that combination is either meaningless in that state, or it has been left undefined. Careful reading of the diagram is exactly how that gap gets caught, before it becomes a real defect. And notice that the data model for an order said nothing about any of this. The two models are complementary. One describes the shape of the information. The other describes its behavior over time.
Table 7.3
State Diagram Notation
Here is the notation at a glance. A state is a distinct condition with its own consistent behavior, drawn as a rounded box with its name. An event is something the system can respond to. It appears as the label on a transition arrow. A transition is the move between states triggered by an event, drawn as a labeled arrow. And the initial state marker is a filled circle, with an arrow into the starting state.
Think About It
A Traffic Light
Here is a question to think about. Take a traffic light, with three states. Green, yellow, and red. Now take one event. A pedestrian presses the crossing button. While the light is green, that press can start the change toward yellow. While the light is red, pedestrians already have their turn, so the press changes nothing. Same event, different meaning, depending on the state.
Key Terms
The Vocabulary of This Section
Let's lock in the key terms. A state is a distinct condition a system or object can be in, during which it behaves consistently. An event is something that happens that a system can respond to. A transition is the move from one state to another, triggered by an event. A state diagram is a model showing a system's states, and the transitions between them. And the initial state is the state before any event has occurred, marked with a filled circle.
Key Takeaways
What to Carry Forward
To pull this together. The same event can produce different results, depending on the state it occurs in. An event is something that happens. A transition is the state change an event can trigger. State diagrams use a filled dot for the initial state, rounded boxes for states, and labeled arrows for transitions. A missing transition is meaningful. It shows a combination that is undefined, or deliberately not allowed. And behavior models and data models complement each other.
About Software Engineering at UPI Study
Software Engineering (Computer Science 301) is a self-paced online course of 103 video lessons in 15 chapters, from process models and agile to requirements, design, user interfaces, reliability, security and project management. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Why take it here
Why students take Software Engineering with UPI Study
Where the credit goes
Universities that work with NCCRS
Software Engineering carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Modeling How Systems Behave Under Different Conditions
What is a state in a UML state diagram?
What is the difference between an event and a transition in a state diagram?
How do you read a state diagram for a media player?
What does a missing transition mean in a state diagram?
About the Software Engineering course
How many college credits is Software Engineering?
How much does Software Engineering cost and what is included?
Which universities accept UPI Study credits?
How long does Software Engineering take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Software Engineering.
103 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
3 credits · NCCRSEnroll →