sif8035 - department of computer science (idi) - ntnusif8035/pdf/flesn/f4.pdf · sif8035 lecture 4...

26
1 SIF8035 Lecture 4 DFD and PrM Events and System Requirements • Events – Occurrences at a specific time and place – Trigger all system processing Requirement definition – Determine relevant events External events first Temporal events second – Decompose system into manageable units

Upload: lekhanh

Post on 13-Jul-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

1

SIF8035

Lecture 4

DFD and PrM

Events and System Requirements

• Events– Occurrences at a specific time and place

– Trigger all system processing

• Requirement definition– Determine relevant events

• External events first

• Temporal events second

– Decompose system into manageable units

Page 2: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

2

Types of events• External events are initiated from outside the system by

external agents or actors– A customer orders products– A customer cancels an order

• Temporal events are triggered by a point of time– The manager requires a monthly production

statement– Invoices must be generated at 3pm

• State events trigger processes based on a system’s changefrom one state or condition to another – something frominside the system

– Manager changes production schedule– Quantity of item falls below re-order level

Naming an Event

– The event name should reveal the system natureof the event

• External event– External agent name followed by a reason

CUSTOMER REQUESTS ACCOUNT BALANCE

• Temporal event– Time to followed by action that must be taken

TIME TO BILL CUSTOMER ACCOUNTS

Page 3: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

3

Events Affecting a Charge AccountProcessing System

Satzinger et al. Fig 5-6

External Event Checklist

Satzinger et al. Fig 5-7

Page 4: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

4

Satzinger et al. Fig 5-8

Temporal Event Checklist

Satzinger et al. Fig 5-9

Actions Leading to Only One EventAffecting the System

Page 5: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

5

Satzinger et al. Fig 5-10

“Transactions” for One CustomerResulting in Many Events

Satzinger et al. Fig 5-14

An Event Table

Also see Satzinger et al. Fig 5-15 for complete event table

Page 6: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

6

Satzinger et al. Fig 6-3

DFD Fragment for the event:“Look up item availability”

Satzinger et al. Fig 6-4

DFD Integrates Event Table andERD

Page 7: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

7

DFD Fragments

• Represents system response to one event within asingle process symbol

• Self contained model

• Focuses attention on single part of system

• Shows only data stores required to respond toevents

Satzinger et al. Fig 6-10

Two DFD Fragments for Order-Entry System

Page 8: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

8

Satzinger et al. Fig 6-11

Combining DFD Fragments

Satzinger et al. Fig 6-13

Detailed Diagram for Create New Order

Page 9: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

9

Decomposing DFD Fragments

• Usually, DFD fragments need to beexplored in more detail

• Broken into sub-processes with additionaldetail

Page 10: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

10

Page 11: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

11

Documentation of DFD Components:Rule Modeling

– Lowest level processes need to be described indetail

– Data flow contents need to be described

– Data stores need to be described

– Various options for process definition exist

Structured English

• Method of writing process specificationsthat combines structured programmingtechniques with narrative English– Well suited to lengthy sequential processes or

simple control logic

– Ill-suited for complex decision logic or fewsequential processing steps

Page 12: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

12

Satzinger et al. Fig 6-20

Structured English Process Description

1. Sequence– A sequence of simple, declarative sentences – one

after another.

– Each sentence uses strong, action verbs such asGET, FIND, DELETE, CREATE, READ,UPDATE, etc

– A formula may be included as part of a sentence CALCULATE grosspay = hoursworked * hourlywage

Page 13: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

13

2. A selection (conditional or decision structure )indicates that a process must perform differentactions under specified conditions.

– The IF-THEN-ELSE allows achoice between twoalternatives

• The CASE construct is used when there are morethan two sets of actions to choose from.

• For logic that is deeply nested use a decision table

3. An iteration (or repetition) structurespecifies that a set of actions should berepeated based on some stated condition.

• The DO-WHILE construct indicates that certainactions are repeated zero, one, or more timesbased on the value of the stated condition.

• The REPEAT-UNTIL constructs indicates thatcertain actions are repeated one or more timesbased on the value of the stated condition.

Page 14: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

14

DO WHILE there are claims remainingIF claimant has not sent in a claim

set up a new claimant recordELSE continueADD claim to YTDClaimIF claimant has policyA THEN subtract excess of $400 from claimELSE subtract excess of $100 from claim

ENDIF …….

…….ENDDO

Decision Tables and Decision Trees

• Can summarize complex decision logicbetter than structured English

• Incorporates logic into the table or treestructure to make descriptions morereadable

Page 15: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

15

Get up decision 1 2 3 4 5Y Y Y Y NY N Y Y -Y - N Y -

able to ignore? Y - - N -X X X

time to get up?tired?

anything planned?

sleepget up X X

Will I get up and go to class?

Decision Trees

• Decision trees are also useful when complexbranching occurs, in a particular order, in astructured decision process

1

2

6

5

4

3Action 1Condition 1

Condition 2

Condition 4

Condition 3Action 2

Action 3

Action 4

Page 16: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

16

Credit limit exceeded

Good paymenthistory

Purchase >$200 - refuse credit

Credit limitnot exceeded

Bad paymenthistory

Refuse credit

Allow credit

Purchase < $200 - refer to boss

Can I purchase goods on credit?

Data Dictionary

• A Data Flow Diagram shows an overview of aninformation system without the clutter of details

• A Data Dictionary is used to document thedetailed descriptions

– of the data that flows through aninformation system and

– the data that is stored by that system

Page 17: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

17

Data Dictionary

... an organised listing of all the data elementsthat are pertinent to the system, with precise,rigorous definitions so that both user and systemsanalyst will have a common understanding of allinputs, outputs, components of stores, andintermediate calculations.

(Yourdan 1989, p189)

• A Data Dictionary contains ‘metadata’;– Data Flows

– Data Records

– Data Elements

– Data Stores

• Data Dictionaries can vary from a stand alonedictionary to those that are fully automated(CASE tools)

Page 18: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

18

Data Dictionary Notation

Symbol

=

+

( )

{ }

[ ]

* *

@ (or underline)

Meaning

is composed of

and

optional

iteration

selection

comment

identifier (key field)

Examples;• StudentName = * A students name*

CourtesyTitle + FirstName + (MiddleName) +LastName

CourtesyTitle = [Mr. | Mrs. | Ms. | Miss | Dr. | Professor]FirstName = {legal-character}MiddleName = {legal-character}LastName = {legal-character}legal character = [A-Z | a-z]

• Order = * A customer order* OrderNo + OrderDate + Department + CustomerNo + {[Item|Service] + Cost} + TotalCost

Page 19: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

19

5.3Compute Current

Pay Amounts

Hours worked

WageInformation

Current PayAmounts

Wage Information = RateofPay + Overtime

Current Pay Amounts =

GrossPay +

TaxDeduction +

SuperDeduction +

NetPay

Structured Program Design

• How do you use DFD diagram toimplement software?

• Structured programming– modules, subprograms (subroutines)

– subprogram structure diagrams

• transform analysis– link between DFD and structure diagrams

Page 20: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

20

Structure Diagram

A

B

A

B

callingsubprogram

calledsubprogram

optional

Example with communicationarrows

Page 21: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

21

Transform analysis

• map functionalspecification toprogrammodules

• include controlrelationships,communication,…

Enter &Verifyorder

Enter &Edit new

VerifyCust credit

Read orderfrom db.

Edit OrderRead cust.data

Rejectorder…..

note optionalprocedure call(DFD?)

Software design

• high subprogram cohesion

• low subprogram coupling

• good structure– hierarchical

– simple interfaces

– …..

Page 22: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

22

PPP – Phenomenon, Process &Program

• better integration of notations

• more expressive notations

• 3 submodels– Phenomenon model (PhM) [ER++]

– Process Model (PrM) [DFD++]

– Process Life Description (PLD)

• more comprehensive code generatrion

DFD: missing detail

• temporal specification– start/stop

– sequence

• computinginput/output relations

• marking of”resources”

A2.1

TT

T

projectleader tool report

Page 23: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

23

Page 24: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

24

PLD – Process Life Description

PrM to PLD

Page 25: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

25

Constructivity

• A system’s properties can be formallyderived from statements of components’structural relationships and components’properties

Page 26: SIF8035 - Department of Computer Science (IDI) - NTNUsif8035/pdf/flesn/f4.pdf · SIF8035 Lecture 4 DFD and PrM ... techniques with narrative English ... Examples; •StudentName =

26

PPP elements