jump to first page 1 system design (finalizing design specifications) chapter 3d

Post on 20-Dec-2015

214 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Jump to first page

1

System Design(Finalizing Design Specifications)

Chapter 3d

Jump to first page

2

Learning Objectives Read and understand a structure chart

Describe measures of good design

Understand cohesion and coupling

Jump to first page

3

Jump to first page

4

The Process of Finalizing Design Specifications

Less costly to correct and detect errors during the design phase

Deliverable: a set of design specifications for the entire system, with detailed functional descriptions of each system component

Jump to first page

5

Design Specification Document Contains:

Overall system description Interface requirements System features Nonfunctional requirements Other requirements Supporting diagrams and models

Jump to first page

6

The Structure Chart

Important program design technique

Shows all components of code in a hierarchical format Sequence – what

order of component? Selection – what

condition? Iteration – how often?

Jump to first page

7

Structure Chart Elements

1.2Calculate

Current GPA

Module

1.1Get Student

Grade Record

Library Module

Loop

Conditional Line

Control Couple

Data Couple

OffPage

Onpage

Jump to first page

8

Steps in Building the Structure Chart1. Identify top level modules and

decompose them into lower levels

2. Add control connections

3. Add couples

4. Review and revise again and again until complete

Jump to first page

9

Jump to first page

10

Jump to first page

11

Jump to first page

12

Design Guidelines

High quality structure charts result in programs that are modular, reusable and easy to implement.

Measures include: Cohesion: extent to which a module

performs a single function Coupling: dependencies between

modules Appropriate levels of fan-in and fan-

out

Jump to first page

13

Design Guidelines

Software is divided into modules. There should be:

Minimum interaction between modules [low coupling] AND

High degree of interaction within a module [high cohesion]

Therefore, an individual module can be DESIGNED, CODED, TESTED OR CHANGED easily.

Jump to first page

14

Types of Cohesion

Functional Sequential Communicational Procedural Temporal Logical Coincidental

Good

Bad

Jump to first page

15

Example of Low CohesionLogical Cohesion

Jump to first page

16

Types of Coupling

Data Stamp Control Common Content

Good

Bad

Jump to first page

17

a

cb

d

hgf

ekj

i

Data structure

Data (Var)

Control flag

No direct coupling

Global data area

Example of Coupling Level

Stampcoupling

datacoupling

controlcoupling

commoncoupling

Jump to first page

18

Fan-in/Fan-out

Jump to first page

19

Fan-in High fan-in preferred Promotes reuse of subordinate modules

1.1CalculateEmployee

Salary

1.2Print

EmployeeRoster

1.3CalculateBenefits

2.1.1Read

EmployeeRecord

1.1CalculateEmployee

Salary

1.2Print

EmployeeRoster

1.3CalculateBenefits

1.1.1Read

EmployeeRecord

1.2.1Read

EmployeeRecord

1.3.1Read

EmployeeRecord

Low fan-in not preferred

Jump to first page

20

Quality Checklist

1. Library modules have been created where ever possible

2. The diagram has a high fan-in structure

3. Control modules have no more than 7 subordinates

4. Each module performs only one function (high cohesion)

5. Modules sparingly share information (loose coupling)

6. Data couples that are passed are actually used by the accepting module

7. Control couples are passed from “low to high”

8. Each module has a reasonable amount of code associated with it

Jump to first page

21

Pseudocode

Method used for representing the instructions inside a module

Language similar to computer programming code

Two functions: Helps analyst think in a structured way about

the task a module is designed to perform Acts as a communication tool between

analyst and programmer

Jump to first page

22

Pseudocode Example

SET total to zero REPEAT

READ Temperature IF Temperature > Freezing THEN

    INCREMENT total END IF

UNTIL Temperature < zero Print total

Jump to first page

23

Summary In this chapter you learned how to:

Read and understand a structure chart Describe measures of good design Understand cohesion and coupling

top related