Software Engineering · Unit 5 · 6 hrs
System Modeling
Exam-focused notes for System Modeling (Software Engineering, CSC375): what the TU syllabus asks and how it has actually been tested, with 7 solved past questions from this unit.
System Modeling in short
System modeling builds abstract, graphical models of a system, each model presenting a different view of it, so requirements can be validated and the system communicated clearly to customers, analysts and engineers before it is built.
What this unit covers
- Introduction to System Modeling
- Context Models
- Interaction Models
- Structural Models
- Behavioral Models
- Model-Driven Architecture
Structural Models
2081 · 5 marks
Differentiate between structural and behavioral models. What is the importance of behavioral model. [5]
2080 · 5 marks
Draw use case diagram and class diagram for online bus ticketing system. [5]
Behavioral Models
2080 · 5 marks
Explain the behavioral model with example. [5]
Show solved answerHide answer
Behavioral Model
Definition
A behavioral model is a type of system model that describes the dynamic behavior of a system as it executes. It shows what happens or what should happen when a system responds to a stimulus from its environment. In other words, it represents how a system changes its state in response to events or data inputs over time.
Behavioral model is one of the four main types of system models (along with Contextual, Interaction, and Structural models) used to represent a system from different perspectives during system modeling.
Purpose
- To show the dynamic aspects of a system
- To describe how a system responds to events or inputs
- To help analysts and designers understand the flow of control and data within a system
- To validate system requirements during requirement engineering
Types of Stimuli in Behavioral Models
Behavioral models can be driven by two types of stimuli:
| Type | Description |
|---|---|
| Data-driven | A sequence of data arrives and the system processes it step by step |
| Event-driven | The system responds to specific events (e.g., user actions, signals) |
Common Notations Used
- State Diagram (State Machine Diagram) - shows states and transitions
- Activity Diagram - shows flow of activities/actions
Example: ATM Behavioral Model (State Diagram)
Consider a simple ATM machine system. Its behavior can be modeled using states and transitions:
[Idle]
|
| Card Inserted
v
[Card Verification]
|
| PIN Entered Correctly
v
[Menu Display]
|
| User selects "Withdraw"
v
[Processing Withdrawal]
|
| Amount Dispensed
v
[Transaction Complete]
|
| Card Ejected
v
[Idle]
Explanation of States:
- Idle: ATM is waiting for a customer
- Card Verification: ATM reads and verifies the inserted card
- Menu Display: Customer is shown available options after successful PIN entry
- Processing Withdrawal: ATM processes the withdrawal request
- Transaction Complete: Cash is dispensed and receipt is printed
- Idle: ATM returns to waiting state after card is ejected
Key Points
- Behavioral models are primarily used in requirement engineering to validate and communicate system functionality
- They help identify what the system does in response to various inputs or events
- They are especially useful for real-time and event-driven systems such as ATMs, traffic control systems, and embedded systems
Summary: A behavioral model captures the dynamic nature of a system by showing how it transitions between states or performs activities in response to stimuli. It is an essential tool for understanding, validating, and communicating system behavior during software development.
2079 · 5 marks
What is behavioral model? Explain with an example. [5]
Show solved answerHide answer
Behavioral Model
Definition
A behavioral model is a type of system model that describes the dynamic behavior of a system as it executes. It shows what happens or what should happen when a system responds to a stimulus from its environment. Behavioral model is one of the four main types of system models used to represent a system from different perspectives (along with contextual, interaction, and structural models).
Behavioral models are primarily used during requirement engineering to help system analysts validate system functionality and communicate clearly with customers about how the system will behave at runtime.
Types of Stimuli in Behavioral Models
Behavioral models are driven by two main types of stimuli:
- Data-driven stimuli -- a sequence of data arrives and the system processes it step by step.
- Event-driven stimuli -- the system responds to a specific event (which may or may not carry data).
Common Notation: State Diagram (State Machine Model)
A widely used behavioral model is the State Diagram (or State Machine Diagram), which shows:
- States -- conditions or situations during the life of a system
- Transitions -- movement from one state to another triggered by an event
- Events/Actions -- what causes the transition or what happens during it
Example: Microwave Oven Behavioral Model
Consider a simple microwave oven system. Its behavior can be modeled as follows:
[Idle] ---(Door Opened)---> [Door Open]
[Door Open] ---(Door Closed)---> [Idle]
[Idle] ---(Set Time & Start)---> [Operating]
[Operating] ---(Timer Expired)---> [Operation Complete]
[Operating] ---(Door Opened)---> [Interrupted]
[Interrupted] ---(Door Closed)---> [Idle]
[Operation Complete] ---(Cancel/Reset)---> [Idle]
Explanation of States:
| State | Description |
|---|---|
| Idle | Microwave is waiting for user input |
| Door Open | Door has been opened; cooking cannot start |
| Operating | Microwave is actively cooking |
| Interrupted | Cooking was stopped because door was opened |
| Operation Complete | Timer has expired; cooking is done |
How it works:
- When the microwave is Idle and the user sets a time and presses Start, it moves to Operating.
- If the door is opened during operation, it moves to Interrupted state for safety.
- Once the timer expires, it moves to Operation Complete and signals the user (e.g., beeps).
- The system returns to Idle after reset or cancel.
Importance of Behavioral Model
- It helps validate requirements by showing how the system reacts to different inputs and events.
- It helps communicate the expected dynamic behavior to both developers and customers.
- It is essential for real-time and safety-critical systems where correct response to events is crucial.
In summary, a behavioral model captures the dynamic, event-driven nature of a system and is a key tool in system modeling for requirement engineering and system design.
Interaction Models
2079 · 5 marks
Draw use case diagram and sequence diagram for online movie ticketing system. [5]
2076 · 5 marks
Discuss the importance of use case diagram in object-oriented development. Draw a use case diagram for library system. [5]
Introduction to System Modeling
Make Unit 5 stick
Practice CSC375 with flashcards & quizzes