Title: Intro to Software System Modeling
1Intro to Software System Modeling
2Model 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
3What 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
4Major Modeling and Design Diagrams
- UML
- Data Flow Diagrams
- State Transition Diagrams
- Structure Charts
- Entity Relationship Diagrams
- Use Cases
5Data Flow Diagrams
- Illustrate how processes transform 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
external entity
data flow
data file
6DFD 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
7DFD Example
Display Panel
display data
Control Keypad
commands
0 Alarm System
alarm type
Alarm
sensor status
Sensors
number tones and recorded msgs
Phone Line
8DFD Example
commands
2 Configure System
config data
config request
1 User Interface
config info
config data
on,off
4 Activate/ Deactivate
on/off msg
passwd
5 Generate Display
display data
3 Check Password
valid id msg
sensor data
alarm type
6 Sensor Monitor
sensor status
number tones and recorded msgs
9State 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
system state
transition
10STD Example
checking password
off
valid passwd
start
activate
invalid passwd
de-activate
working idle
valid passwd
problem
valid passwd
alerting via alarm
alerting via phone
not acknowledged
invalid passwd
11Petri Nets - similar to STDs
http//www.ppgia.pucpr.br/maziero/diversos/petri/
net.png
12Structure Charts
- Illustrates Control Flow
- Very good for conveying the design of source code
- Very inappropriate for modeling a system in a SRS
module
13SC 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
14SC Example
main
check_sensors
get_cmd
Is this correct?
turn_off
change_ phone_num
activate_ alarm
send_ phone_msg
check_passwd
15SC Example
main
check_sensors
get_cmd
turn_off
change_ phone
activate_ alarm
send_ phone_msg
check_passwd
16Entity 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
17ER Example
monitors
enables/disables
security system
sensor
tests
programs is programmed by
18Use 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.
system components
an action done by an actor
actor
19Example Use Case
Alarm System
smoke detector
access sensor status via internet
motion detector
configure the sensor ranges
home owner
turn on and off
Other Use Cases other homeowner
activities security guard burglar
20Use Cases for System Modeling
21Example 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?
22Example 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?
23Summary
- 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