Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

SOICT

School of Information and Communication Technology


IT4082E – Introduction to
Software Engineering
09 – Requirement Modeling

3
Requirement Steps

4
1. What’s
modeling?
• A complicated object in the real
world, e.g., an airplane
• How can you make it?
• How can you know its design?
• …

5
What is a model?

• A model is a simplification of reality.

6
Why model?

• Modeling achieves four aims:


• Helps you to visualize a system as you want it to be.
• Permits you to specify the structure or behavior of a system.
• Gives you a template that guides you in constructing a system.
• Documents the decisions you have made.
• You build models of complex systems because you cannot comprehend
such a system in its entirety.
• You build models to better understand the system you are developing.

7
Discussion

• How do you build a paper airplane?


• If it cannot fly, what will you do?

• What about a fighter jet?

8
The important of modeling

Less Important More Important

Paper Airplane Fighter Jet

9
Model as a blueprint of a system
Approach: Floorplan
2. Design
1. Requirements

• Shall fit on given 3. System

http://wikimedia.org (CC nc-sa 3.0, Ottoklages)


piece of land.
• Each room shall
have a door.
• Furniture shall fit
into living room.
• Bathroom shall
have a window.
• Cost shall be in http://wikimedia.org
budget. (CC nc-sa 3.0,
Bobthebuilder82)
– 1 – 2013-10-21 – Smodel –

10
Observation: Floorplan abstracts from, e.g., . . .
• kind, number, and placement of bricks, • water pipes/wiring, and
• subsystem details (e.g., window style),
Model as a blueprint of a system

Floorplan as an Abstraction
Floorplan
γ
all houses

F
F •

• •
H

α
α

Floorplan F
•• Floorplan F denotes
denotes a set γ(F ) of houses (concretisations of F ), 11
Smodel ––

which differ,
which differ, e.g.
e.g. in
in colour
colour of bricks, or making of windows.
2013-10-21 –– Smodel

Floorplan F
•• Floorplan F represents
represents house H according to abstraction α.
2013-10-21

By adding
•• By adding information
information to F (such as making of windows),
Principals of modeling

4 fundamental principals of modeling:

• The model you create influences how the problem is attacked.

• Every model may be expressed at different levels of precision.

• The best models are connected to reality.

• No single model is sufficient.

12
Principal 1: the choice of model is important

• The models you create profoundly influence how a problem is


attacked and how a solution is shaped

• In software, the models you choose greatly affect your world view

• Each world view leads to a different kind of system.

Process Model Deployment Model Design Model

13
Principal 2: Levels of precision may differ

• Every model may be expressed at different levels of precision

• The best kinds of models let you choose your degree of detail,
depending on:
• Who is viewing the model

• Why they need to view it

View for Customers View for Designers

14
Principal 3: The best
models are connected to
reality
• All models simplify reality
• A good model reflects potentially fatal
characteristics.

15
Principal 4: No single
model is sufficient
• No single model is sufficient. Every non-
trivial system is best approached
through a small set of nearly
independent models: 4+1 View
• Create models that can be built and
studied separately, but are still
interrelated.

16
Modeling tools for software requirements

Model many different aspects of software systems with the following


common tools:
• Model how data is transported and processed: data flow diagrams
• Modeling state changes of data objects in the system: finite state
machine diagrams
• Representing relationships between data objects: entity-relationship
diagrams
• Modeling interactions between users and systems: use case diagrams
and activity diagrams

17
Data Flow Diagram

• DFD
• A formal way to represent how a business takes place in practice
• DFD represents business processes of a system and how data flows
are transmitted among these processes
• 2 types of processes:
• Logical process: only represents the business and does not contain details
about actual installation or implementation
• Physical process: contains additional information about real-world
implementations

18
Components of a DFD

Component Main information Symbol


Process - ID
- Name (Verb)
- Description
- May have one or more incoming
data flows
- May have one or more outgoing Visio 2000 Gane Sarson
data flows DFD

Data flow - Name (noun)


- Description
- Connections between processes Name

19
Components of a DFD (2/2)

Component Main information Symbol


Data store - ID
- Name (noun)
- Description
- May have one or more
Visio 2000
incoming data flows
- May have one or more
outgoing data flows
Gane Sarson
DFD
External entity - Name (noun)
- Description

Gane Sarson
Visio 2000
DFD
20
Example
• A DFD represents the course registration
process
• What are
• Entities
• Processes
• Data stores
• Data flows

21
Finite State Machine

• State Machine Diagram


• Goal:
• Model the state transition of a single object through a series of events
• For example: Modeling the state of a door
• Object: door
• Status: closed / opened / locked
• Events leading to state changes: Open / Close / Lock / Unlock

22
Example

Discussion:
• Are all events valid
for all states?

23
Components of State Machine Diagram (1/2)
Component Main information Symbol
State Name (noun)

Initial state May not have a specific name

Final state May not have a specific name

Transition Source state, target state,


event/trigger constraints
which lead to the state
changes
Self-transition Source state = target state

24
Components of State Machine Diagram (2/2)

With transitions:
• Their labels represent events or triggers that, when these events or
triggers occur, will lead to a state transition

• Event generation may need to be performed under certain constraints,


then conditions will be added next to the events.

25
Case study

Use a state machine diagram to model the state of the elevator


according to the following specification:
• Initially the elevator is set up on the 1st floor, status: On first floor
• The elevator can be in the state of moving up (Moving up) when there
is a command to go up (go up).
• The elevator can be in the moving down state when there is a
command to go down.
• The elevator can be in idle state when there are no requests. The
elevator cannot change state from moving up to moving down.
• After a certain period of time (timeout), the elevator will automatically
move to the first floor (Moving to first floor).

26
Case study (2/2)

27
Entity Relation Diagram

• ERD
• Used to model data entities and their relationships in relational
database systems
• ERD can be used to specify data requirements as well as be used in the
design phase.

28
Components of ERD

Component Information Symbol


Entity Name (noun)

Relation between entities Name (verb)

Features of an entity Name of feature (noun)

29
Example

• The library management system requires management of the following


data objects:
• Book: book-id, title, author, price, available
• Publisher: pub-id, address, name
• Member: member-id, member-date, expired-date, member-type, address, name
• Relationships between entities:
• Book – published by – Publisher
• Book – borrowed by – Member

30
Solution

Book-id
Pub-id
Title Author

Address
Price Available
Book
Publisher
Published
by
Name
Member- Borrowed
id by

Expired-
date Member Name

Member-
Address
date Member-
type
31
09 – Requirement Modeling
(end of lecture)

32

You might also like