Beruflich Dokumente
Kultur Dokumente
Software
Design
Internal Design
External Design
External Design involves conceiving, planning out, and
specifying the externally observable characteristics of
software product. The external design includes
• User displays and report format
•External data source and sinks
•Functional Characteristics
• Performance requirement and high level process
structure.
Internal Design
Internal design involves conceiving, planning out and
specifying the internal structure and processing
details of the software. The main aim is to record
•Design decisions
•Indicate why certain alternative and trade-off were
chosen
•Elaborate test plan
•To provide a blue print for implementation, testing
and maintenance activity,
Internal Design
Outcome of Internal Design are
• Architectural structure
• Details of algorithms and data structures
• Test plan
Architectural Design
• Concerned with refining the conceptual view of the
system.
• Identifying internal processing functions
• Decomposing high-level functions into sub
functions.
• Defining internal data streams and data stores
• Establishing the relationship and interconnection
between among functions and data streams and
data stores.
Detailed Design
• includes specification of algorithm that
implement the functions.
• Concrete data structure that implement the
data stores.
• The actual interconnection among the
functions and data structures
• Packaging scheme for system
Phases Analysis Design Implementation
Design acti
vities
Architectur
al Abstract Interface Component Data Algorithm
design specifica
tio design design structur
e design
n design
Software Data
System Interface Component Algorithm
specifica
tion structure
architectur
e specifica
tion specifica
tion specifica
tion
specification
Design pr
oducts
Design phases
• Architectural design Identify sub-systems
• Abstract specification Specify sub-systems
• Interface design Describe sub-system interfaces
• Component design Decompose sub-systems
into components
• Data structure design Design data structures to hold
problem data
• Algorithm design Design algorithms for problem
functions
Design Concepts
• Abstraction
• Structure
• Information hiding
• Modularity
• Concurrency
• Verification
• Design aesthetics
Abstraction
•Abstraction is the intellectual tool that allow us to
deal with concept apart from their
implementations.
•Abstraction permits the separation of conceptual
aspects from the implementation details.
•Abstraction allow us to organize and channel out
our thought process by postponing the structural
consideration and detailed algorithm details until
the functional characteristics, data streams and
data stores have been established.
Abstraction Mechanism
• Functional Abstraction
• Data abstraction
• Control abstraction
Functional Abstraction
• Involves the use of parameterized sub program. The
ability to parameterized a sub program and to bind
different parameter values on different invocations
of the subprogram is a powerful abstraction
mechanism.
• Functional abstraction can be generalized to
selection of sub programs called as groups.
• Some of these subprograms may have visible
property and some may be hidden,
Data Abstraction
• Involves specifying a data type or data object by
specifying legal operations on them; representation
and manipulation details are suppressed. E.g. for
stack can specify POP, PUSH operation without their
actual implementation.
• Abstract data type are abstract in the sense that the
representation details of the data items and the
implementation detail of functions that manipulate
the data items are hidden within the group that
implements the abstract data type.
Control Abstraction
• Is used to state a desired effect without
stating the exact mechanism of control. e.g. IF
and WHILE statements are example of
abstraction of machine code implementation
that involves conditional jump instruction.
“ for all I in S sort files I”
Information Hiding
• Using Information hiding approach, each
module in the system hides the internal
details of its processing activities and
modules communicate only through well
defined interfaces.
• Design should begin with the a list of difficult
design decisions and design decisions likely to
change.
Information Hiding
• Each module is designed to hide such a decision
from other modules.
Other candidates for information hiding include
• A data structure, its internal linkages, and the
implementation details of the procedures that
manipulate it.
• The format of control blocks such as those for
queues in an operating system.
• Character codes, ordering of character set, and
other implementation details.
Information Hiding
• Shifting, masking, and other machine
dependent details.
Structure
• The use of structuring permits the
decomposition of large system into smaller,
more manageable units with well-defined
relationships to the other units of the system.
• The most general form of the system structure is
the network. A computing network can be
represented as directed graph, consisting of
nodes and arcs.
• The nodes can represent processing elements
that transform the data and the arcs can be used
to used to represent data links between nodes.
Structure
• Alternatively node can represent data stores and and
the arcs data representation.
• A network might specify the data flow and
processing steps for single subprogram or the data
flow among a collection of sequential subprograms.
• The most complex form of computing network is a
distributed computing system in which each node
represents a geographically distinct process with
private memory.
Structure
• Inside each processes one might have
functional abstraction groups ,data
abstraction groups and control abstraction
group.
• Each group might consist of visible
specification part and a hidden body.
Modularity
Modular systems consist of a well defined,
manageable units with well defined interfaces among
units Desirable properties of modular system includes]
Flow of Data
Processing
Data Store
Example of DFD
Shipping
Order
Process Instruction
Customer Package
Order Order
Invoice
Customer Info
Structure Charts
• Used during architectural design to document
hierarchical structure, parameters, and
interconnections in a system.
A Selection
Repetition
B C D E
F G H
in out
1
2
3
4 Input Output
5 Data Data
6
7
8
HIPO diagrams
• HIPO diagrams( Hierarchy-Process-Input-Output) were
developed at IBM as design representation scheme for top-
down software development, and as external
documentation aids for released products.
Legend 1
2 5 8
3 4 6 7 9 12
Contents
1. --- 10 11
2. ---
3. ---
Procedure Templates
• Procedure interface specifications are
effective notations for architectural design
when used in combination with structure
charts and data flow diagrams.
• They also provide a natural transition from
architectural to detailed design and from
detailed design to implementation.
Procedure Templates
PROCEDURE NAME:
PART OF( subsystem name & number)
CALLED BY:
PURPOSE:
DESIGNER/DATE(s): LEVEL 1
PARAMETERS:(names,modes,attributes,purpose)
INPUT ASSERTION: ( preconditions)
OUTPUT ASSERTION:(post conditions)
GLOBALS:( name, modes,attributes, purposes, shared with)
SIDE EFFECTS: LEVEL 2
Procedure Templates
LOCAL STRUCTURES: (names, attributes,purposes)
EXCEPTIONS: (conditions, responses)
TIMING CONSTRAINTS:
OTHER LIMITATIONS: LEVEL 3
P P
S1 S2
S
REPEAT S UNTIL P
IF P THEN S1 ELSE S2
WHILE P DO S
Structured English
Structured English can be used to provide a step-by-
step specification for an algorithm. Structured English
can be used at any desired level of detail. Structured
English is often used to specify cookbook recipes.
1.Preheat Oven to 350 degree F.
2.MIX eggs,milk, and vanilla.
3.Add flour and baking soda.
4.Pour into a greased baking dish
5.Cook until done.
Decision Tables
Decision tables can be used to specify
complex design logic in a high level
software specification. They are useful
for specifying algorithm logic during
detailed design.
Module-Level Concepts
• Now we will consider some concepts specific
to function oriented design.
• A module is a logically separable part of a
program.
• In a system using functional abstraction,
coupling and cohesion are two modularization
criteria, which are often used together.
Cohesion
• Cohesion of a module represent how tightly bound
the internal elements of the module are to one
another.
• We are interested in determining how closely the
elements of module are related to one another.
• The greater the cohesion of each module in the
system, the lower the coupling between module is.
Cohesion
• A measure of how well a component 'fits
together'
• A component should implement a single logical
entity or function
• Cohesion is a desirable design component
attribute as when a change has to be made, it
is localised in a single cohesive component
• Various levels of cohesion have been identified
Cohesion levels
• Coincidental cohesion (weak)
– Parts of a component are simply bundled together
• Logical association (weak)
– Components which perform similar functions are
grouped
– For example:
output text to screen
output line to printer
output record to file
– Seems ok
– Problem is it carries out a range of similar but
different actions
– No single well defined action
Cohesion levels
Module A Module B
Module C Module D
Shared data
area
Loose coupling
Module A
A’s data
Module B Module C
Module D
D’s data
Coupling levels
B C D
E o O selection
F 0
* Zero or more
occurrences
G * H I
Specification of object A using Jackson Structured Programming notation
• The second step of Jackson method involves
converting the input and output structures into a
structural model of the program.
• The third step expands the structural model of
the program into a detailed design model
a) A list of operations required to perform the
processing steps is developed.
b) the operations are associated with the program
structure
c) Program structure and operations are expressed
in a notation called schematic logic, which is
stylized pseudocode. Control flow for selection
and iteration are specified in this step.
Input and output structure of an inventory
program
Part Group*
heading Body
Movement *
record
NET *
Issue o Receipt o MOVEMENT
TIME
Correspondence between Input and output
structure of an inventory program
Part Group*
heading Body
Movement *
record
NET *
Issue o Receipt o MOVEMENT
TIME
Program Structure for an inventory problem
Program
Process Process
heading Body
Process PTGP *
and line
Process Process
PTGP Body line
Process Record *
1. OPEN FILES
2. CLOSE FILES
3. STOP RUN
4. READ A RECORD INTO PART_NUM,
MOVMNT
5. WRITE HEADING
6. WRITE NET_MOVEMENT LINE
7. SET NET_MOVMNT TO ZERO
8. ADD MOVMNT TO NET_MOVMNT
Association of operations wit Program Structure
Program
Process Process
1 4 5 heading Body
2 3
Process PTGP *
and line
Process Process
7 PTGP Body 6
line
4 Process Record *