intro to software system modeling. model vs design model may be used in the srs used by the...
TRANSCRIPT
Intro to Software System Modeling
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
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…
Major Modeling and Design DiagramsMajor Modeling and Design Diagrams
UML
Data Flow Diagrams
State Transition Diagrams
Structure Charts
Entity Relationship Diagrams
Use Cases
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
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
DFD Example
0
AlarmSystem
ControlKeypad
Sensors
PhoneLine
Alarm
DisplayPanel
commands
sensorstatus
displaydata
alarmtype
number tonesand recorded msgs
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
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
STD Example
workingidle
alertingvia
phone
alertingvia
alarm
offcheckingpassword
valid passwd
activate de-activateinvalidpasswd
invalidpasswd
validpasswd
not acknowledged
validpasswd problem
start
Petri Nets - similar to STDs
http://www.ppgia.pucpr.br/~maziero/diversos/petri/net.png
Structure Charts Illustrates ControlControl Flow Very good for conveying the designdesign of
source code Very inappropriate for modeling a system in
a SRS
module
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
SC Example
main
check_sensorsget_cmd
turn_offchange_
phone_numactivate_
alarmsend_
phone_msg
check_passwd
Is this correct?
SC Example
main
check_sensorsget_cmd
turn_offchange_phone
activate_alarm
send_phone_msg
check_passwd
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
ER Example
securitysystem
sensor
monitors
enables/disables
tests
programsis programmed by
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
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
Use Cases for System Modeling
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
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?
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