intro to software system modeling. model vs design model may be used in the srs used by the...

23
Intro to Software System Modeling

Upload: ethel-wilkins

Post on 03-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Intro to Software System Modeling

Page 2: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Model vs DesignModel vs Design Model

may be used in the SRS used by the software designers may be useful as an overview for the programmers

may be used for validation with the customer

Design what the programmers are told to build

Page 3: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

What info is modeled? Relationships between Data Process Flow Data Transformation Control Flow within the source code Format of the Database Timing constraints (real-time systems) User Interface Flow etc…

Page 4: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Major Modeling and Design DiagramsMajor Modeling and Design Diagrams

UML

Data Flow Diagrams

State Transition Diagrams

Structure Charts

Entity Relationship Diagrams

Use Cases

Page 5: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Data Flow Diagrams Illustrate how processes transform datatransform data Very good for modeling a system at a high

level, e.g. for the SRS Poor at conveying design of software, except

a few cases such as distributed systems

process externalentity

data file data flow

Page 6: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

DFD Syntax Rules a model is composed of a series of diagrams that

present more and more detail

the top-level diagram is the "context" level and contains only one process (our software)

data cannot just appear or disappear, i.e. inputs and outputs must match between levels

process numbers indicate both family and level of detail

all data flows are defined in a Data Dictionary

Page 7: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

DFD Example

0

AlarmSystem

ControlKeypad

Sensors

PhoneLine

Alarm

DisplayPanel

commands

sensorstatus

displaydata

alarmtype

number tonesand recorded msgs

Page 8: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

DFD Example

1

UserInterface

commands

sensorstatus

displaydata

alarmtype

number tonesand recorded msgs

6

SensorMonitor

3

CheckPassword

2

ConfigureSystem

4

Activate/Deactivate 5

GenerateDisplay

config info

passwd

on,off

configrequest

valid id msg

configdata

configdata

on/off msg

sensor data

Page 9: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

State Transition Diagrams Illustrates events and their effects on the

system's state or status Good for

design of user interfaces real-time and event-based systems

systemstate

transition

Page 10: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

STD Example

workingidle

alertingvia

phone

alertingvia

alarm

offcheckingpassword

valid passwd

activate de-activateinvalidpasswd

invalidpasswd

validpasswd

not acknowledged

validpasswd problem

start

Page 11: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Petri Nets - similar to STDs

http://www.ppgia.pucpr.br/~maziero/diversos/petri/net.png

Page 12: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Structure Charts Illustrates ControlControl Flow Very good for conveying the designdesign of

source code Very inappropriate for modeling a system in

a SRS

module

Page 13: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

SC Syntax Rules one single tree for entire system tree has one node at the top nodes are individual code units / modules nodes call nodes below them nodes are called left to right leaf nodes are usually utility modules may show data flow may show conditionals and loops

Page 14: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

SC Example

main

check_sensorsget_cmd

turn_offchange_

phone_numactivate_

alarmsend_

phone_msg

check_passwd

Is this correct?

Page 15: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

SC Example

main

check_sensorsget_cmd

turn_offchange_phone

activate_alarm

send_phone_msg

check_passwd

Page 16: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Entity Relationship Diagrams Illustrates connections between data objects

Excellent for design of a database

Good for modeling or specifying what data a system should handle

Cardinality = max number of objects that can participate in the relationship

Modality = is the relationship required

Page 17: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

ER Example

securitysystem

sensor

monitors

enables/disables

tests

programsis programmed by

Page 18: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Use Cases Illustrates activities performed by the user. Excellent for modeling a system

helps identify data, processes, features Not directly a design spec, but shows

programmers the context of their code.

actor

an action doneby an actor

systemcomponents

Page 19: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Example Use Case

homeowner

access sensorstatus via internet

configure thesensor ranges

Alarm System

smoke detector

motion detector

turn on and off

Other Use Cases:other homeowner activitiessecurity guard burglar

Page 20: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Use Cases for System Modeling

Page 21: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Example Modeling Problem System Req : every employee has a home office Does "home office" mean they have a spare

bedroom at home with a computer, or that everyone is assigned to a regional main office?

employee home office

employee home office

Page 22: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Example Modeling Problem Any user can delete a regular file, but deleting

a reserved file must require a password confirmation.

Unclear : can any user delete a "reserved file"? How do we show that Requirement in the SRS? How do we show that in the Design?

Page 23: Intro to Software System Modeling. Model vs Design  Model may be used in the SRS  used by the software designers  may be useful as an overview for

Summary Good for Modeling:

Use Cases what the user wants to do

DFDs process / how the data is transformed

ERs structure and nature of the data

Good for Design: Structure Charts ERs