5 System Modeling

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.

System Modeling: notes

Introduction to System Modeling

System modeling is the process of developing abstract models of a system, with each model presenting a different view or perspective of it. It helps a systems analyst validate the system's functionality and communicate clearly with customers about their needs, so it is used heavily during requirements engineering, where it helps identify and validate the requirements of a new system by exposing the scope and limitations of the existing one; models are also used during design, to describe the system to the engineers who will implement it. System models are usually expressed using a standard graphical notation, most often the Unified Modeling Language (UML), and fall into four broad perspectives: context models (what lies outside the system), interaction models (how the system and its environment, or its own components, exchange messages), structural models (how the system is organised), and behavioural models (how the system responds dynamically over time).

Context Models

A context model shows the operational environment of a system: what lies outside its boundary, and how the system connects to the other systems around it. The environment of a system contains social and organisational concerns that directly or indirectly shift where the system's boundary should be drawn, so a context model is normally built early in the process, both to control cost and to help define requirements and design clearly from the outset. For example, a mental healthcare information system's context model would show the system at the centre, connected to the other systems it must exchange data with:

Related systemRelationship to the mental healthcare system
Patient record systemSupplies and receives patient identification and history data.
Admissions systemNotifies the system when a patient is admitted or discharged.
Appointments systemShares clinic and consultation scheduling data.
Prescription systemReceives prescribing information generated during a consultation.
Management reporting systemConsumes summarised data for organisational reporting.
Healthcare statistics systemConsumes anonymised data for national health statistics.

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]

According to system modeling, different types of models represent a system from different perspectives. Structural and behavioral models are two important perspectives among them. Basis Structural Model Behavioral Model --------- Definition Models the organization of a system or the structure of ...

Open this answer on its own page →

2080 · 5 marks

Draw use case diagram and class diagram for online bus ticketing system. [5]

--- A use case diagram shows the interactions between the system and its environment (actors). It focuses on the functional requirements and provides an outside view of the system. - Passenger (primary actor) - Admin (primary actor) - Payment Gateway (external system/actor) - Register / Login - S...

Open this answer on its own page →

Behavioral Models

2080 · 5 marks

Explain the behavioral model with example. [5]

Show solved 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:

TypeDescription
Data-drivenA sequence of data arrives and the system processes it step by step
Event-drivenThe system responds to specific events (e.g., user actions, signals)

Common Notations Used

  1. State Diagram (State Machine Diagram) - shows states and transitions
  2. 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.

Open this answer on its own page →

2079 · 5 marks

What is behavioral model? Explain with an example. [5]

Show solved 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:

  1. Data-driven stimuli -- a sequence of data arrives and the system processes it step by step.
  2. 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:

StateDescription
IdleMicrowave is waiting for user input
Door OpenDoor has been opened; cooking cannot start
OperatingMicrowave is actively cooking
InterruptedCooking was stopped because door was opened
Operation CompleteTimer 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.

Open this answer on its own page →

Interaction Models

2079 · 5 marks

Draw use case diagram and sequence diagram for online movie ticketing system. [5]

--- A use case model is a graphical representation of the interactions among the elements of a system and its external entities called actors. It focuses on the functional requirements and provides an outside view of the system. - User/Customer (primary actor) - Admin (primary actor) - Payment Ga...

Open this answer on its own page →

2076 · 5 marks

Discuss the importance of use case diagram in object-oriented development. Draw a use case diagram for library system. [5]

Use case diagrams show the interactions between the system and its environment. They are one of the key UML diagram types used in object-oriented development. Their importance can be discussed as follows: Use case diagrams help identify and document what the system must do from the user's perspec...

Open this answer on its own page →

Introduction to System Modeling

2076 · 10 marks

Explain system modeling with suitable example.[10]

System modeling is the process of developing abstract models of a system, with each model presenting a different view or perspective of that system. It helps system analysts to validate the system's functionality and helps to communicate clearly with customers about their needs. Hence, it is main...

Open this answer on its own page →