2080 12

CSC375 ยท 2080 ยท 5 marks

Explain the behavioral model with example.

Explain the behavioral model with example. [5]

Software EngineeringChapter 5: System ModelingBehavioral Models

Quick answer

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

Definition

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.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.