System models - Alexandria University

Download Report

Transcript System models - Alexandria University

Software Engineering
Software Specification Models
The Waterfall Model
Requirements
Definition
System and
Software design
Implementation
and Unit Testing
Integration and
System Testing
Operation and
Maintenance
Focus on models
Operational process
Information
System
Model
ANALYSIS PHASE
The development process starts with the analysis
phase. This phase results in a specification
document that shows what the software will do
without specifying how it will be done. The analysis
phase can use two separate approaches, depending
on whether the implementation phase is done using
a procedural programming language or an objectoriented language.
System modelling
System modelling helps the analyst
to understand the functionality of
the system and models are used to
communicate with customers
Stages of Design

Problem understanding
•

Identify one or more solutions
•

Evaluate possible solutions and choose the most
appropriate depending on the designer's experience and
available resources.
Describe solution abstractions
•

Look at the problem from different angles to discover the
design requirements.
Use graphical, formal or other descriptive notations to
describe the components of the design.
Repeat process for each identified abstraction
until the design is expressed in primitive terms.
Requirements Specification: Approaches
• Natural language
• Structured natural language
• Design description language
• Requirements specification language
• Graphical notation
• Formal specification
Procedure-oriented analysis
Procedure-oriented analysis—also called
structured
analysis
or
classical
analysis—is the analysis process used if
the system implementation phase will
use a procedural language. The
specification in this case may use several
modeling tools, but we discuss only a
few of them here.
Data flow diagrams
Data flow diagrams show the movement of data in the
system.
Entity-relationship diagrams
Another modeling tool used during the analysis
phase is the entity-relationship diagram. This
diagram is also used in database design.
Entity-Relation Diagram
An entity
A relation between
entities
An entity or relation
attribute
An inheritance
relation
Example: CS 311 Project
Major
Client
1
Student
Project
1
CS311
Student
5 to 7
Member of
0:n
Person
0:n
0:n
Tech contact
Example: CS 305 Project
Major
Client
0:n
1
Student
Project
Person
0:n
1
CS305
Student
5 to 7
Member of
0:n
Tech contact
State diagrams
State diagrams provide another useful tool that
is normally used when the state of the entities
in the system will change in response to events.
As an example of a state diagram, we show the
operation of a one-passenger elevator. When a
floor button is pushed, the elevator moves in
the requested direction. It does not respond to
any other request until it reaches its
destination.
An example of a state diagram
Object-oriented analysis
Object-oriented analysis is the
analysis process used if the
implementation uses an objectoriented
language.
The
specification document in this case
may use several tools.
Use case diagrams
A use-case diagram gives the user’s view of a system: it
shows how users communicate with the system. A use-case
diagram uses four components: system, use cases, actors and
relationships. A system, shown by a rectangle, performs a
function.
Class diagrams
The next step in analysis is to create a class
diagram for the system. For example, we can
create a class diagram for our old-style
elevator. To do so, we need to think about the
entities involved in the system.
State chart
After the class diagram is finalized, a state
chart can be prepared for each class in the
class diagram. A state chart in objectoriented analysis plays the same role as
the state diagram in procedure-oriented
analysis.
Microwave oven state description
State
Waiting
Half p ower
Full power
Set time
Disabled
Enabled
Operation
Description
The oven is waiting for input. The display shows the current time.
The oven power is set to 300 watts. The display shows ‘ Half
power’.
The oven power is set to 600 watts. The display shows ‘ Full
power’.
The cooking time is set to the user’s input value. T he display
shows the cooking time selected and is updated as the time is set.
Oven operation is disabled for safety. Interior oven light is on.
Display shows ‘Not ready’.
Oven operation is enabled. Interior oven light is off . Display
shows ‘Ready to cook’.
Oven in operation. Interior oven light is on. Display shows the
timer countdown. On completion of cooking, the buzzer is
sounded for 5 seconds. Oven light is on. Display shows ‘Cooking
complete’ while buzzer is sounding.
Microwave oven model
Full
power
Full power
do: set power
= 600
Timer
Waiting
do: display
time
Half
power
Number
Full
power
Half
power
Door
closed
Timer
Door
open
Half power
do: set power
= 300
Operation
do: operate
oven
Set time
do: get number
exit: set time
Door
closed
Disabled
do: display
'Waiting'
Cancel
Start
Enabled
do: display
'Ready'
Door
open
Waiting
do: display
time
Microwave oven operation
Operation
Checking
do: check
status
Turntable
fault
Time
Cook
do: run
generator
OK
Emitter
fault
Timeout
Done
do: buzzer on
for 5 secs.
Alarm
do: display
event
Door
open
Disabled
Cancel
Waiting
Data Flow Diagrams



DFDs model the system from a functional
perspective
Tracking and documenting how the data
associated with a process is helpful to
develop an overall understanding of the
system
Data flow diagrams may also be used in
showing the data exchange between a
system and other systems in its environment
4 Main Elements




external entity - people or organisations that
send data into the system or receive data from
the system
process - models what happens to the data i.e.
transforms incoming data into outgoing data
data store - represents permanent data that is
used by the system
data flow - models the actual flow of the data
between the other elements
SYMBOLS USED IN A DFD
± PROCESS
± DATA FLOW
Actions performed on data
so that they are
transformed, stored or
distributed.
E.g. Result of a query to a
database, contents of a printed
report : data that moves
together to common
destinations
SYMBOLS USED IN A DFD
± DATA STORE
A physical location to hold
data e.g. a file folder or
notebook etc.
±
SOURCE/SINK
Origin and/or destination
of the data. Often referred
to as external entities as
they are outside the
system.
Example: University Admissions
Rejection
Application
Completed
form
Receive application
Evaluate
application
Applicant
Offer
Example: University Admissions
Assemble Application Stage
Acknowledgment
Application
form
Receive
Applicant
Completed
application
Acknowledgment
AND
Initiate
evaluation
Evaluation
request
AND
Supporting
information
Pending
database
Applicant
database
Example: University Admissions
Process Completed Application Stage
Rejection
Evaluation
request
Evaluation
Acceptance
Special
request
Applicant
database
Financial
aid
Offer
DFD Shapes from Visio
Visio 2000
Visio 5.x
From Flow Chart /
Data Flow Diagram
From Software Diagram /
Gane-Sarson DFD
From Flow Chart /
Data Flow Diagram
ID #
Process
Process
Process
Data Store
Data Store
1
Data Store
ID
#
External Entity
External
Entity
External
Entity
Reading a DFD
Levelled DFDs

Even a small system could have many
processes and data flows and DFD could
be large and messy
• use levelled DFDs - view system at different
levels of detail
• one overview and many progressively greater
detailed views
4
Relationship Among DFD levels
Level 0 - Context Diagram



models system as one process box which
represents scope of the system
identifies external entities and related inputs
and outputs
Additional notation - system box
External
entity
Data f low out
Data f low in
Sy stem box
Level 1 - overview diagram




gives overview of full system
identifies major processes and data flows between
them
identifies data stores that are used by the major
processes
boundary of level 1 is the context diagram
Level 2 Diagrams




level 1 process is expanded into more detail
each process in level 1 is decomposed to show its
constituent processes
Level 2 diagrams may not be needed for all level
1 processes
Correctly numbering each process helps the user
understand where the process fits into the overall
system
Numbering




On level 1 processes are numbered
1,2,3…
On level 2 processes are numbered x.1,
x.2, x.3… where x is the number of the
parent level 1 process
Number is used to uniquely identify
process not to represent any order of
processing
Data store numbers usually D1, D2, D3...
Labelling




Process label - short description of what
the process does, e.G. Price order
Data flow label - noun representing the
data flowing through it e.G. Customer
payment
Data store label - describes the type of
data stored
Make labels as meaningful as possible
Context Diagram
Staff Assignment
Campaign
Manager
Payment
Accountant
Campaign
Staff
Client
Staff Grade
Budget
Agate
Campaign
Management
System
Advert Completion
Client Contact
Advert
Campaign
Staff
Concept Note
Concept Note
Staff
Staff
Contact
Top Level Diagram (Level 0)
Client
Staff
Clients
1.
Record
Clients
Campaign
Manager
Staff
Client
4.
Maintain
Staff
Staff Grade
Staff Members
Payment
Staff
Campaign
Staff
Budget
Staff Assignment
Accountant
2.
Plan and
Manage
Campaigns
Campaigns
Campaign
Contact
Cost + Completion Date
Concept Note
5.
Manage
Adverts
Staff
Contact
Client Contact
Adverts
Advert
Campaign
Staff
Advert Completion
3.
Prepare
Adverts
Advert
6.
Browse
Concept
Notes
Concept Note
Notes
Concept
Note
Concept
Note
Staff
Level 1 Diagram
Staff Members
Client Contact
Staff
5.1
Set Client
Contact
Contact
Adverts
Advert Completion
5.2
Set Advert
Completed
Completion Date
Example




Alexsoft shop buys software from various suppliers
and sells it to the public
The shop stocks popular software packages and
orders as required
The shop sells monthly about 300 packages
The shop need to be computerized
System requirements



Business functions, account payable, accounts
receivable and inventory
The system is batch or online
One computer with appropriate configuration
DFD
Package data
Package details
order
Process
order
Customer
invoice
Credit status
Customer data
DFD (2)
Package data
Package details
order
Customer
invoice
Assemble
order
Verify order
is valid
details
Credit status
Customer data
DFD (3)
Verify order
is valid
Details of package to
be ordered
Pending orders
Batched order
Place order at
supplier
Address or telephone
Software
Supplier
DFD (4)
Package data
Package details
order
Customer
invoice
Assemble
order
payment
Payment to
invoice
Verify order
is valid
details
Credit status
Account
receivable
Customer data
Level 0 Context diagram
CUSTOMER
KITCHEN
0
Food
ordering
system
RESTAURANT
MANAGER
Level 0 Context diagram
CUSTOMER
KITCHEN
0
Customer Order
Food
ordering
system
Receipt
Management
Reports
RESTAURANT
MANAGER
Food Order
1.0
Receive and
transform
Customer Food
Order
3.0
2.0
Update
Goods
Sold file
Update
Inventory
file
4.0
Produce
Management
Reports
CUSTOMER
KITCHEN
1.0
Customer Order
Receive and
transform
Customer Food
Order
Food Order
Receipt
D1
Goods Sold
File
3.0
2.0
Update
Goods
Sold file
Update
Inventory
file
D2 Inventory File
4.0
Produce
Management
Reports
Management
Reports
RESTAURANT
MANAGER
CUSTOMER
KITCHEN
1.0
Customer Order
Receipt
3.0
Food Order
Goods
Inventory
Sold
Data
2.0
Update
Inventory
file
Update
Goods
Sold file
Goods
Sold Data
D1
Receive and
transform
Customer Food
Order
Goods Sold
File
Daily Goods Sold
Amount
Inventory Data
D2 Inventory File
4.0
Produce
Management
Reports
Daily Inventory Depletion Amounts
Management
Reports
RESTAURANT
MANAGER
DFD Example : Payroll
Creating Data Flow Diagrams
Lemonade Stand Example
Creating Data Flow Diagrams
Example
The operations of a simple
lemonade stand will be used
to demonstrate the creation
of dataflow diagrams.
Steps:
1. Create a list of activities
•
Old way: no Use-Case Diagram
•
New way: use Use-Case Diagram
2. Construct Context Level DFD
(identifies sources and sink)
3. Construct Level 0 DFD
(identifies manageable sub processes )
4. Construct Level 1- n DFD
(identifies actual data flows and data stores )
Creating Data Flow Diagrams
Example
1. Create a list of activities
Think through the activities
that take place at a lemonade
stand.
Customer Order
Serve Product
Collect Payment
Produce Product
Store Product
Creating Data Flow Diagrams
Example
1. Create a list of activities
Also think of the additional
activities needed to support
the basic activities.
Customer Order
Serve Product
Collect Payment
Produce Product
Store Product
Order Raw Materials
Pay for Raw Materials
Pay for Labor
Creating Data Flow Diagrams
Example
1. Create a list of activities
Group these activities in
some logical fashion,
possibly functional areas.
Customer Order
Serve Product
Collect Payment
Produce Product
Store Product
Order Raw Materials
Pay for Raw Materials
Pay for Labor
Creating Data Flow Diagrams
Example
2. Construct Context Level DFD
(identifies sources and sink)
Create a context level
diagram identifying the
sources and sinks (users).
Context Level DFD
Order
Customer Order
Serve Product
Collect Payment
Produce Product
Store Product
Order Raw Materials
Pay for Raw Materials
Pay for Labor
CUSTOMER
Sales Forecast
0.0
Lemonade Production Schedule EMPLOYEE
Pay
System
Product Served
Payment
Received Goods
Payment
VENDOR
Time Worked
Purchase Order
Creating Data Flow Diagrams
Example
Create a level 0 diagram
identifying the logical
subsystems that may exist.
3. Construct Level 0 DFD
(identifies manageable sub processes )
Level 0 DFD
1.0
Sale
Customer Order
Serve Product
Collect Payment
Product Ordered
Payment
CUSTOMER
Produce Product
Store Product
Order Raw Materials
Pay for Raw Materials
Pay for Labor
Sales Forecast
Customer Order
Product Served
Received Goods
VENDOR
Purchase Order
Production
Schedule
2.0
Production
EMPLOYEE
Inventory
3.0
Procurement
Payment
Order
Decisions
Pay
4.0
Payroll
Time Worked
Creating Data Flow Diagrams
Example
Create a level 1
decomposing the processes
in level 0 and identifying
data stores.
4. Construct Level 1- n DFD
(identifies actual data flows and data stores )
Level 1 DFD
CUSTOMER
Customer Order
Customer Order
Serve Product
Collect Payment
Produce Product
Store Product
Order Raw Materials
Pay for Raw Materials
Pay for Labor
ORDER
1.1
Record
Order
Severed Order
Payment
1.2
Receive
Payment
PAYMENT
Request for Forecast
1.3
Produce
Sales
Forecast
Sales Forecast
Creating Data Flow Diagrams
Example
Create a level 1
decomposing the processes
in level 0 and identifying
data stores.
4. Construct Level 1 (continued)
Level 1 DFD
Product Order
ORDER
Customer Order
Serve Product
Collect Payment
Produce Product
Store Product
Order Raw Materials
Pay for Raw Materials
Pay for Labor
2.1
Serve
Product
Quantity Severed
RAW
MATERIALS
Production
Schedule
2.2
Produce
Product
Production Data
2.3
Store
Product
Quantity Used
INVENTORTY
Quantity Produced &
Location Stored
Creating Data Flow Diagrams
Example
Create a level 1
decomposing the processes
in level 0 and identifying
data stores.
Customer Order
Serve Product
Collect Payment
4. Construct Level 1 (continued)
Level 1 DFD
Order Decision
3.1
Produce
Purchase
Order
Quantity On-Hand
Quantity
Received
Received
Goods
3.2
Receive
Items
Produce Product
Store Product
Order Raw Materials
Pay for Raw Materials
PURCHASE
ORDER
Payment Approval
3.3
Pay
Vendor
Pay for Labor
Payment
RAW
MATERIALS
RECEIVED
ITEMS
VENDOR
Creating Data Flow Diagrams
Example
Create a level 1
decomposing the processes
in level 0 and identifying
data stores.
Customer Order
Serve Product
Collect Payment
4. Construct Level 1 (continued)
Level 1 DFD
Time Worked
4.1
Record
Time
Worked
TIME CARDS
Employee ID
EMPLOYEE
Payroll Request
4.2
Calculate
Payroll
Produce Product
Store Product
Unpaid time cards
PAYROLL
Payment Approval
Order Raw Materials
Pay for Raw Materials
4.3
Pay
Employe
e
Pay for Labor
Payment
PAYMENTS
Process Decomposition
0.0
Lemonade
System
Context Level
1.0
Sale
1.1
Record
Order
1.2
Receive
Payment
2.0
Production
2.1
Serve
Product
2.2
Produce
Product
2.3
Store
Product
3.0
Procurement
3.1
Produce
Purchase
Order
3.2
Receive
Items
3.3
Pay
Vendor
4.0
Payroll
4.1
Record
Time
Worked
4.2
Calculate
Payroll
4.3
Pay
Employe
e
Level 0
Level 1
DFD Example: Bus Garage Repairs



Buses come to a garage for repairs.
A mechanic and helper perform the repair, record
the reason for the repair and record the total cost of
all parts used on a Shop Repair Order.
Information on labor, parts and repair outcome is
used for billing by the Accounting Department,
parts monitoring by the inventory management
computer system and a performance review by the
supervisor.
DFD Example: Bus Garage Repairs
(cont’d)



External Entities: Bus, Mechanic, Helper,
Supervisor, Inventory Management System,
Accounting Department, etc.
Key process (“the system”): performing repairs and
storing information related to repairs
Processes:
•
•
•
•
•
Record Bus ID and reason for repair
Determine parts needed
Perform repair
Calculate parts extended and total cost
Record labor hours, cost
DFD Example: Bus Garage Repairs
(cont’d)

Data stores:
•
•
•
•

Personnel file
Repairs file
Bus master list
Parts list
Data flows:
•
•
•
•
•
Repair order
Bus record
Parts record
Employee timecard
Invoices
Bus Garage Context Diagram
Bus
Fixed
mechanical
problems
Mechanical
problem
to be repaired
Helper
Labor
Labor
Mechanic
Bus
Repair
Process
System
Labor,
parts cost
details
Repair
summary
List of
parts used
Supervisor
Inventory
Managemen
t System
Accountin
g
CSUB Burger’s Order Processing System

Draw the CSUB Burger’s context diagram
•
System
» Order processing system
•
External entities
» Kitchen
» Restaurant
» Customer
•
Processes
»
»
»
»
Customer order
Receipt
Food order
Management report
Joe’s builders’ suppliers has a shop and a yard. He has a
stock list on the wall of his shop, complete with prices.
When a builder wants to buy supplies, he goes into the
shop and picks the stock items from the list. He writes
his order on a duplicate docket and pays Joe, who stamps
the docket as paid. The builder takes the duplicate docket
and he goes to the yard and hands it to the yard foreman.
The yard foreman gets the ordered items from the yard
and gives them to the builder. The builder signs the
duplicate docket and leaves one copy with the foreman
and takes one copy as a receipt. Every week, Joe looks
around the yard to see if any of his stock is running low.
He rings up the relevant suppliers and reorders stock.
He records the order in his order book, which is kept in
the yard. The yard foreman takes delivery of the new
stock and checks it against what has been ordered. He
pays for it on delivery and staples the receipt into the
order book. At the end of every month, Joe goes through
all the dockets and the order book and produces a
financial report for the shareholders.
Context diagram
Shareholders
financial
report
Docket &
Payment
Joe's
Yard
Supply needs
Joe
Customer
Signed docket
Supply order
& payment
Supply invoice
Supplier
Level-1 DFD processes
Joe’s builders’ suppliers has a shop and a yard. His system is
entirely manual. He has a stock list on the wall of his
shop, complete with prices. When a builder wants to buy
supplies, he goes into the shop and picks the stock items
from the list. He writes his order on a duplicate docket
and pays Joe, who stamps the docket as paid. The builder
takes the duplicate docket and he goes to the yard and
hands it to the yard foreman. The yard foreman gets the
ordered items from the yard and gives them to the
builder. The builder signs the duplicate docket and
leaves one copy with the foreman and takes one copy as a
receipt. Every week, Joe looks around the yard to see if
any of his stock is running low. He rings up the relevant
suppliers and reorders stock. He records the order in his
order book, which is kept in the yard. The yard foreman
takes delivery of the new stock and checks it against what
has been ordered. He pays for it on delivery and staples
the receipt into the order book. At the end of every
month, Joe goes through all the dockets and the order
Level 1 current physical
20
Buy
supplies
Money
Payment
Supplier
receipt
22
Payment
Docket &
Payment
Payment
Restock
supplies
Docket
Supplier
Customer
M1
completed
docket copy
supplies
Supply order
Docket
completed
docket copy
required stock
stock
Signed docket
12
builder
signature
*
Supply order
get
items
11
Take
to
yard
Order
book
M3
required stock
completed
docket copy
Supplier
receipt
Joe
Supply needs
21
Reorder
supplies
Signed docket
Signed docket
5
Joe's Office
Produce
financial
report
Foreman
financial
report
*
Shareholders
Buy Supplies
20 Buy supplies
Customer
M1
Docket
20.1
Docket
Docket
Writes
Order
*
Payment
Docket
20.3
Stamp
Docket(signature)
20.2
Payment
Pays
Joe
*
*
Money
Get Items
12 get items
12.2
Foreman
Signed docket
12.1
Get builder
signature
Signed docket
*
Give items
to customer
Customer
*
required stock
builder
signature
completed
docket copy
completed
docket copy
stock
12.3
Give
copy
as receipt
*
Reorder supplies
21 Reorder supplies
21.1
Joe
Supply needs
Reorder
from
yard
*
Supply needs
21.2
Supply order
Record
order
*
M3
Order
book
Restock
22 Restock
M3
Order
book
Supply order
22.1
stock
supplies
Take
delivery
*
supplies
Supply order
Money
Payment
22.2
Supplier
receipt
Pay
supplier
*
Payment
Supplier