1 Structured Analysis Techniques. 2 Data Flow Diagrams.

20
1 Structured Analysis Structured Analysis Techniques Techniques

Transcript of 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

Page 1: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

1

Structured Analysis Structured Analysis TechniquesTechniques

Page 2: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

2

Data Flow Data Flow DiagramsDiagrams

Page 3: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

3

PrPrococesess s

momodeldelss

Process models show the overall Process models show the overall process and the processes that process and the processes that are supported by the systemare supported by the system

A systems analysis process model A systems analysis process model consists of data flow diagrams consists of data flow diagrams (DFDs).(DFDs). A data flow diagram (DFD) depicts A data flow diagram (DFD) depicts

the flow of data through a system the flow of data through a system and the work or processing and the work or processing performed by that system.performed by that system.

Page 4: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

4

PrPrococesess s

momodeldelss

Data flow diagrams (DFDs)Data flow diagrams (DFDs) The DFD allows the system to be partitioned The DFD allows the system to be partitioned

into independent units so that they, and into independent units so that they, and thereby the system, can be more easily thereby the system, can be more easily understood.understood.

The graphical aspect of DFDs means that The graphical aspect of DFDs means that they can be used both as static pieces of they can be used both as static pieces of documentation and as a communication tool.documentation and as a communication tool.

DFD's contain four components:DFD's contain four components: processesprocesses data flowsdata flows data storesdata stores sources and sinkssources and sinks

Page 5: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

Goods Purchase - Level 1

OrderGoods

Preparecheck

Receivedeliverynote

Verifyinvoice

orderdelivery note

invoiceSupplier

Orders File Delivery Notes

Invoice Filecheque

Shop

goods_request

Supplier

(Source)

(Dataflow)

(Process)

(Datastore)

(Sink)

Page 6: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

6

PrPrococesess s

momodeldelss

DFD componentsDFD components Processes Processes

The rectangles represent Processes or work to be done. A The rectangles represent Processes or work to be done. A process is work performed on, or in response to, incoming process is work performed on, or in response to, incoming data flows. data flows.

A process must have at least one data flow into it and one A process must have at least one data flow into it and one data flow out of it. data flow out of it.

Processes cannot exist independently.Processes cannot exist independently.

External agents External agents The circles represent - the boundary of the system. An The circles represent - the boundary of the system. An

external agent defines a person, organization unit, other external agent defines a person, organization unit, other system or other organization that lies outside the scope of system or other organization that lies outside the scope of the project but that interacts with the system being the project but that interacts with the system being studied studied

External agents provide the net inputs into a system and External agents provide the net inputs into a system and receive net outputs from a system.receive net outputs from a system.

Page 7: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

7

PrPrococesess s

momodeldelss

DFD Components (cont.)DFD Components (cont.) data flows data flows

The arrows represent, inputs and outputs, to The arrows represent, inputs and outputs, to and from the processes. and from the processes.

A data flow is also used to represent the A data flow is also used to represent the creation, deletion or updating of data in a creation, deletion or updating of data in a file or database. file or database.

A good analogy is that of a conveyor belt in A good analogy is that of a conveyor belt in a factory which takes data from one 'worker' a factory which takes data from one 'worker' to another. Each 'worker' then performs to another. Each 'worker' then performs some process which may then result in some process which may then result in another data flow on the conveyor belt.another data flow on the conveyor belt.

Page 8: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

8

PrPrococesess s

momodeldelss

DFD Components (cont.)DFD Components (cont.) data stores data stores

The open-ended boxes represents files or The open-ended boxes represents files or databases etc.. Data stores correspond to all databases etc.. Data stores correspond to all instances of a single entity in a data model.instances of a single entity in a data model.

A data flow from a data store to a process A data flow from a data store to a process indicates that data are to be “read” for indicates that data are to be “read” for some specific purpose.some specific purpose.

A data flow from a process to a data store A data flow from a process to a data store indicates that data are to be created, indicates that data are to be created, deleted, or updated in/from that data store.deleted, or updated in/from that data store.

Page 9: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

9

Illegal data Illegal data flowsflows

Agent 1 Agent 2

fileAgent 3

file Agent 3

file file

Page 10: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

10

PrPrococesess s

momodeldelss

DFD LevelingDFD Leveling DFDs allow the analyst or user to look at the system at DFDs allow the analyst or user to look at the system at

different levels of detail. Even in quite small systems a different levels of detail. Even in quite small systems a level 1 DFD may contain many processes and look level 1 DFD may contain many processes and look cluttered.cluttered.

To overcome this it is usual to 'break down' the level To overcome this it is usual to 'break down' the level one DFD into a set of DFDs, a practice known as one DFD into a set of DFDs, a practice known as levelling.levelling.

Context diagramsContext diagrams A Context DFD represents a system at a high level of A Context DFD represents a system at a high level of

detail in terms of its inputs from external entities and detail in terms of its inputs from external entities and its outputs to external entities.its outputs to external entities.

A context diagram comprises one process box for the A context diagram comprises one process box for the entire system, together with the external entities and entire system, together with the external entities and the data flows that pass between them and the system.the data flows that pass between them and the system.

Page 11: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

11

PrPrococesess s

momodeldelss

Level 1 diagrams.Level 1 diagrams. A level 1 DFD shows the system (as initially A level 1 DFD shows the system (as initially

represented in a context diagram) in more detail.represented in a context diagram) in more detail. A level 1 diagram must have exactly the same A level 1 diagram must have exactly the same

inputs and outputs as the context diagram since it inputs and outputs as the context diagram since it represents the same system but in more detail.represents the same system but in more detail.

The processes modelled in a level 1 diagram (and The processes modelled in a level 1 diagram (and also in any further sub-levels), represent a also in any further sub-levels), represent a breakdown of the activities which make up the breakdown of the activities which make up the system.system.

Level 2 diagramsLevel 2 diagrams A level 2 diagram may exist for every process on a A level 2 diagram may exist for every process on a

level 1 diagram. That is, each level 2 diagram level 1 diagram. That is, each level 2 diagram relates to a single process on the corresponding relates to a single process on the corresponding level 1 diagram.level 1 diagram.

Page 12: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

1

2

3

Sub-Process

2.1

2.2

2.3

2

Sub-sub-Process

2.2.1

2.2.2

2.2.3

2.2 2.2

ElementaryProcessDescription

-Decisiontables

-DecisionTrees

-StructuredEnglish

Level 0 Level 1 Level 2 Level 3 Level 4

OverallProcess

Process

Page 13: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

13

PrPrococesess s

momodeldelss

Advantages of DFDsAdvantages of DFDs Since they are easily understood by users, they Since they are easily understood by users, they

are easier to validate for correctness. It is are easier to validate for correctness. It is therefore easy to determine whether therefore easy to determine whether requirements are correct.requirements are correct.

DFDs allow the analyst to abstract to whatever DFDs allow the analyst to abstract to whatever level of detail is required so that it is possible level of detail is required so that it is possible to examine a system in overview and at a more to examine a system in overview and at a more detailed level.detailed level.

The DFD specifies the system at a logical level The DFD specifies the system at a logical level rather than a physical level. The benefit of this rather than a physical level. The benefit of this separation is that the users can specify their separation is that the users can specify their requirements without any restriction being requirements without any restriction being imposed of a design nature, for example, the imposed of a design nature, for example, the exact hardware requirements.exact hardware requirements.

Page 14: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

14

ExExamample ple 11

Description of a Purchasing SystemDescription of a Purchasing System The purchasing system receives requests for goods The purchasing system receives requests for goods

from the shop manager.from the shop manager. The purchasing system orders goods from a The purchasing system orders goods from a

Supplier.Supplier. When goods are ordered, the order is sent to the When goods are ordered, the order is sent to the

Supplier, and details are stored in the orders file.Supplier, and details are stored in the orders file. When the Supplier sends a delivery note this is When the Supplier sends a delivery note this is

recorded in the delivery-note file.recorded in the delivery-note file. When the Supplier sends an invoice this is verified When the Supplier sends an invoice this is verified

by reading the delivery-note file, and then recording by reading the delivery-note file, and then recording the details in the invoice file.the details in the invoice file.

Cheques are then prepared by reading the invoice Cheques are then prepared by reading the invoice file, checking this against the orders file, and then file, checking this against the orders file, and then sending out a check to the Supplier.sending out a check to the Supplier.

Page 15: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

15

ExExamample ple 11

Process Input Output External Agents Data Store

Order Goods goods request order; order dets shop; supplier order-file

Receive Delivery Note delivery note note details supplier delivery notes

verify invoice invoice invoice details supplier invoice-file

prepare cheque invoice details; cheque supplier invoice-file;

order details order-file

Page 16: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

16

ExExamample ple 11

GoodsPaymentSystem

delivery-note

invoice

order

Supplier

Shop goods_request

cheque

Goods Payment System - Context Level

Page 17: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

Goods Purchase - Level 1

OrderGoods

Preparecheck

Receivedeliverynote

Verifyinvoice

orderdelivery note

invoiceSupplier

Orders File Delivery Notes

Invoice Filecheque

Shop

goods_request

Supplier

Page 18: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

18

ExExamample ple 22

Another example - Order verification systemAnother example - Order verification system

A customer sends in an order form containing A customer sends in an order form containing details of their order, and their membership details of their order, and their membership number. A check is made to ensure that they are number. A check is made to ensure that they are a member. a member.

After the order is verified for membership After the order is verified for membership credentials, a check is made to verify that the credentials, a check is made to verify that the items ordered are produced by the company. items ordered are produced by the company.

If the order is valid it is used to create an invoice, If the order is valid it is used to create an invoice, which is sent on to the Order Fulfilment System.which is sent on to the Order Fulfilment System.

Page 19: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

19

Customer Order verification

system

Order Fulfilment

order_form Invoice

ExExamample ple 22

Order Verification System - Order Verification System - Context LevelContext Level

Page 20: 1 Structured Analysis Techniques. 2 Data Flow Diagrams.

20

Customer

Verifyclubmembership

Verify itemordered

Createinvoice

Order Fulfilment

Member file Items file

order_form

member_dets

verifiedorder

valid order

items_dets

invoice

ExExamample ple 22

Order Verification - Level 1Order Verification - Level 1