Unit III - Software Design
Unit III - Software Design
Design process - Modular design - Design heuristic - Design model and document -
Architectural design - Software architecture - Data design - Architecture data - Transform and
transaction mapping - User interface design - User interface design principles.
• The data design transforms the information domain model created during analysis into
the data structures that will be required to implement the software. The data objects and
relationships defined in the entity relationship diagram and the detailed data content
depicted in the data dictionary provide the basis for the data design activity.
• The architectural design defines the relationship between major structural elements of
the software, the “design patterns” that can be used to achieve the requirements that
have been defined for the system, The architectural design representation the
framework of a computer-based system can be derived from the system specification,
the analysis model, and the interaction of subsystems defined within the analysis mode.
• The interface design describes how the software communicates within itself, with
systems that interoperate with it, and with humans who use it. data and control flow
diagrams provide much of the information required for interface design.
Design Principles
Design process should not suffer from “tunnel vision”
The design should be traceable to the analysis model
The design should not reinvent the wheel; Time is short
The design should “minimize intellectual distance” between the software and the
problem in the real world
The design should exhibit uniformity and integration
The design should be structured to accommodate change
The design should be structured to degrade gently.
Design is not coding, coding is not design
The design should be assessed for quality as it is being created, not after the fact
The design should be reviewed to minimize conceptual errors
Design Concepts
Fundamental concepts which provide foundation to design correctly:
• Abstraction
• Refinement
• Modularity
• Software Architecture
• Control Hierarchy
• Structural Partitioning
• Data Structure
• Software Procedure
• Information Hiding
Abstraction
• Identifying important features for representation
• There are many levels of abstraction depending on how detailed the representation is
required
• Data abstraction - representation of data objects
• Procedural abstraction - representation of instructions
Refinement
• Stepwise refinement - top-down design strategy by Niklaus Wirth
• Refinement is actually a process of elaboration
• Starting at the highest level of abstraction, every step of refinement „decompose‟
instructions into more detailed instructions
• Complementary to abstraction
Modularity
• Software is divided into separately named and addressable components, often called
modules, that are integrated to satisfy problem requirements.
• “Divide and conquer” approach - problem is broken into manageable pieces
• Solutions for the separate pieces then integrated into the whole system
Divide and Conquer
Software Architecture
• Modules can be integrated in many ways to produce the system
• Software architecture is the overall structure of the software
• The hierarchy of components and how they interact, and the structure of data used by
the components
• Use of framework models, and possible reuse of architectural patterns
Control Hierarchy
• Control hierarchy, also called program structure, represents the organization of program
components (modules) and implies a hierarchy of control.
• Hierarchy of modules representing the control relationships
• A super-ordinate module controls another module
• A subordinate module is controlled by another module
• Measures relevant to control hierarchy: depth, width, fan-in, fan-out
• Depth and width provide an indication of the number of levels of control and overall span
of control.
• Fan-out is a measure of the number of modules that are directly controlled by another
module. Fan-in indicates how many modules directly control a given module.
Structural Partitioning
• Program structure partitioned horizontally and vertically
• Horizontal partitioning defines separate branches for each major program function -
input, process, output
• Vertical partitioning defines control (decision-making) at the top and work at the bottom
Software Procedure
• Processing details of individual modules
• Precise specification of processing, including sequence of events, exact decision points,
repetitive operations, and data organization/structure
• Procedure is layered - subordinate modules must be referenced in processing details
Information Hiding
• Information (procedure and data) contained within a module is inaccessible to other
modules that have no need for such information
• Effective modularity is achieved by independent modules, that communicate only
necessary information
• Ease of maintenance - testing, modification localized and less likely to propagate
Data Structure
• Data structure is a representation of the logical relationship among individual elements
of data.
3.2 Modular Design
• Functional Independence
• Designing modules in such a way that each module has specific functional requirements.
Functional independence is measured using two terms cohesion and coupling.
Cohesion
Internal interaction of the module.
Cohesion is a measure of relative functional strength of a module
The degree to which all elements of a component are directed towards a single task and
all elements directed towards that task are contained in a single component.
Types of cohesion
Logical Cohesion
Coincidental cohesion
Temporal Cohesion
Procedure Cohesion
Communication Cohesion
Sequential cohesion
Informational cohesion
Functional cohesion
Coincidental cohesion
Coupling
• Coupling is a measure of relative independence among modules, that is it is a measure
of interconnection among modules.
• Loose coupling means component changes are unlikely to affect other components.
• Shared variables or control information
exchange lead to tight coupling.
• Loose coupling can be achieved by state
decentralization (as in objects) and component
communication via parameters or message
passing.
Tight Coupling
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
Range of Coupling
Types of coupling
Content coupling
Common Coupling
Control Coupling
Stamp Coupling
Data Coupling
Content coupling
• One module directly refers to the content of the other
– Module a modifies statement of module b
Common Coupling
• Common coupling exists when two or more modules have read and write access to the
same global data.
Control Coupling
• Two modules are control-coupled if module 1 can directly affect the execution of module 2
Stamp Coupling
• It is a case of passing more than the required data values into a module
• Two modules are stamp coupled if a data structure is passed as a parameter, but the
called module operates on some but not all of the individual components of the data
structure
Data Coupling
• Two modules are data coupled if all parameters are homogeneous data items [simple
parameters, or data structures all of whose elements are used by called module]
• The final section of the Design Specification contains supplementary data. Algorithm
descriptions, alternative procedures, tabular data, excerpts from other documents, and
other relevant information
• This architecture is applied when input data are to be transformed through a series of
computational or manipulative components into output data.
• A pipe and filter pattern has a set of components, called filters, connected by pipes
that transmit data from one component to the next.
• Each filter works independently of those components upstream and downstream, is
designed to expect data input of a certain form, and produces data output (to the next
filter) of a specified form.
• The filter does not require knowledge of the working of its neighboring filters.
Call and return architectures
• This architectural style enables a software designer to achieve a program structure that
is relatively easy to modify and scale.
• Main program/subprogram architectures. This classic program structure decomposes
function into a control hierarchy where a “main” program invokes a number of program
components, which in turn may invoke still other components.
• Remote procedure call architectures. The components of a main program/
subprogram architecture are distributed across multiple computers on a network
Object-oriented architectures
• The components of a system encapsulate data and the operations that must be applied
to manipulate the data.
• Communication and coordination between components is accomplished via message
Passing.
Layered architectures
• Incoming flow: Information enters the system along paths that transform external data
into internal data
• Transform flow: Internal data is processed
• Outgoing flow: Internal data are transformed into external data
Transactional Flow
• Data “continuously” moves through a collection of incoming flow processes, reaches a
particular transaction center process, and then follows one of a number of actions paths.
Each action path is again a collection of processes.
• Mapping the transform data flow diagram into software architecture design model
• Input: transform data flow diagram
• Output: software architecture
Step1:Review the fundamental system model
What is fundamental system model?
o Top-level or 0-level data flow diagram
Why reviewing the fundamental system model?
o To evaluate the SRS in order to guarantee that the system model conforms to
the real system
Level 0 DFD
Step2: Review and Refine Data Flow Diagram for the Software
• DFD is correct
• Produce greater detail
• Each transform in the data flow diagram exhibits relatively high cohesion that can be
implemented as a component in software
Level 1 DFD
Transform mapping
Level 1 DFD
Level 2 DFD for user interaction sub system
Step 3. Determine whether the DFD has transform or transaction flow characteristics.
• Steps 1, 2, and 3 are identical to corresponding steps in transform mapping.
• The DFD shown in Figure has a classic transaction flow characteristic. However, flow
along two of the action paths emanating from the invoke command processing bubble
appears to have transform flow characteristics.
• Flow boundaries must be established for both flow types.
• Transaction flow is mapped into an architecture that contains an incoming branch and a
dispatch branch
• The structure of the incoming branch is developed in much the same way as transform
mapping. Starting at the transaction center, bubbles along the incoming path are
mapped into modules.
• The structure of the dispatch branch contains a dispatcher module that controls all
subordinate action modules.
• Each action flow path of the DFD is mapped to a structure that corresponds to its
specific flow characteristics.
First level factoring for user interaction sub system
Step 6:Factor and Refine the Transaction Structure and Each Action Path
Step 7. Refine the first-iteration architecture using design heuristics for improved
software quality.
Interface Analysis
Interface analysis means understanding
(1) the people (end-users) who will interact with the system through the interface;
(2) the tasks that end-users must perform to do their work,
(3) the content that is presented as part of the interface
(4) the environment in which these tasks will be conducted.
User Analysis
• Are users trained professionals, technician, clerical, or manufacturing workers?
• What level of formal education does the average user have?
• Are the users capable of learning from written materials or have they expressed a
desire for classroom training?
• Are users expert typists or keyboard phobic?
• What is the age range of the user community?
• Will the users be represented predominately by one gender?
• How are users compensated for the work they perform?
• Do users work normal office hours or do they work until the job is done?
• Is the software to be an integral part of the work users do or will it be used only
occasionally?
• What is the primary spoken language among users?
• What are the consequences if a user makes a mistake using the system?
• Are users experts in the subject matter that is addressed by the system?
• Do users want to know about the technology the sits behind the interface
Design Evaluation
Reference Books: