Unit 3
Unit 3
Software design is the last software engineering action within the modeling activity and sets the
stage for construction (code generation and testing).
The flow of information during software design is illustrated in Figure below. The analysis model,
manifested by scenario-based, class-based, flow-oriented and behavioral elements, feed the
design task.
The architectural design defines the relationship between more structural elements of the software,
the architectural styles and design patterns that can be used to achieve the requirements defined
for the system, and the constraints that affect the way in which the architectural design can be
implemented.
The architectural design can be derived from the System Specs, the analysis model, and
interaction of subsystems defined within the analysis model.
Component -
sc enario- based f low- oriented L evel Design
elements elements
use-cases - text data flow diagrams
use-case diagrams control-flow diagrams
activity diagrams processing narratives
swim lane diagrams
Int erfac e Design
Analysis Model
Design Model
9-2 SEPA, 6/e Instructor’s Guide
The interface design describes how the software communicates with systems that interpolate with
it, and with humans who use it. An interface implies a flow of information (data, and or control) and
a specific type of behavior.
The component-level design transforms structural elements of the software architecture into a
procedural description of software components.
The importance of software design can be stated with a single word – quality. Design is the place
where quality is fostered in software engineering. Design provides us with representations of
software that can be assessed for quality. Design is the only way that we can accurately translate
a customer’s requirements into a finished software product or system.
Software design is an iterative process through which requirements are translated into a
“blueprint” for constructing the software.
Initially, the blueprint depicts a holistic view of software, i.e. the design is represented at a high-
level of abstraction.
Throughout the design process, the quality of the evolving design is assessed with a series of
formal technique reviews or design walkthroughs.
The design must implement all of the explicit requirements contained in the analysis model,
and it must accommodate all of the implicit requirements desired by the customer.
The design must be a readable, understandable guide for those who generate code and for
those who test and subsequently support the software.
The design should provide a complete picture of the software, addressing the data, functional,
and behavioral domains from an implementation perspective.
Software Design
Quality Guidelines
In order to evaluate the quality of a design representation, we must establish technical criteria for
good design.
2. A design should be modular; that is, the software should be logically partitioned into elements
or subsystems
3. A design should contain distinct representations of data, architecture, interfaces, and
components.
4. A design should lead to data structures that are appropriate for the classes to be implemented
and are drawn from recognizable data patterns.
5. A design should lead to components that exhibit independent functional characteristics.
6. A design should lead to interfaces that reduce the complexity of connections between
components and with the external environment.
7. A design should be derived using a repeatable method that is driven by information obtained
during software requirements analysis.
8. A design should be represented using a notation that effectively communicates its meaning.
Quality Attributes
Hewlett-Packard developed a set of software quality attributes that has been given the acronym
FURPS. The FURPS quality attributes represent a target for all software design:
Functionality: is assessed by evaluating the features set and capabilities of the program, the
generality of the functions that are delivered, and the security of the overall system.
Usability: is assessed by considering human factors, overall aesthetics, consistency, and
documentation.
Reliability: is evaluated by measuring the frequency and severity of failure, the accuracy of
output results, the mean-time-to-failure, the ability to recover from failure, and the predictability
of the program.
Performance: is measured by processing speed, response time, resource consumption,
throughput, and efficiency.
Supportability: combines the ability to extend the program extensibility, adaptability,
serviceability maintainability. In addition, testability, compatibility, configurability
etc.
9-4 SEPA, 6/e Instructor’s Guide
Design Concepts
This section discusses many significant design concepts (abstraction, refinement, modularity,
architecture, patterns, refactoring, functional independence, information hiding, and OO design
concepts).
Abstraction
At the highest level of abstraction, a solution is stated in broad terms using the language of the
problem environment. At lower levels of abstraction, a more detailed description of the solution is
provided.
As we move through different levels of abstraction, we work to create procedural and data
abstractions. A procedural abstraction refers to a sequence of instructions that have a specific and
limited function. An example of a procedural abstraction would be the word open for a door.
A data abstraction is a named collection of data that describes a data object. In the context
of the procedural abstraction open, we can define a data abstraction called door. Like any data
object, the data abstraction for door would encompass a set of attributes that describe the door
(e.g. door type, swing direction, weight).
Architecture
Software architecture alludes to the “overall structure of the software and the ways in which
the structure provides conceptual integrity for a system.”
In its simplest from, architecture is the structure of organization of program components (modules),
the manner in which these components interact, and the structure of data that are used by the
components.
The goal of software design is to derive an architectural framework of a system.
The architectural design can be represented using one or more of a number of different models
Patterns
A design pattern “conveys the essence of a proven design solution to a recurring problem within a
certain context amidst computing concerns.”
A design pattern describes a design structure that solves a particular design problem within a
specific context
Modularity
Software architecture and design patterns embody modularity; that is, software is divided into
separately named and addressable components, sometimes called modules that are integrated to
satisfy problem requirements.
Software Design
Monolithic software (large program composed of a single module) cannot be easily grasped by a
software engineer. The number of control paths, span of reference, number of variables, and
overall complexity would make understanding close to impossible.
It is the compartmentalization of data and function. It is easier to solve a complex problem when
you break it into manageable pieces. “Divide-and-conquer”
Don’t over-modularize. The simplicity of each small module will be overshadowed by the
complexity of integration “Cost”.
Information Hiding
It is about controlled interfaces. Modules should be specified and design so that information
(algorithm and data) contained within a module is inaccessible to other modules that have
no need for such information.
Hiding implies that effective modularity can be achieved by defining by a set of independent
modules that communicate with one another only that information necessary to achieve software
function.
The use of Information Hiding as a design criterion for modular systems provides the greatest
benefits when modifications are required during testing and later, during software maintenance.
Because most data and procedures are hidden from other parts of the software, inadvertent errors
introduced during modifications are less likely to propagate to other location within the software.
Functional Independence
The concept of functional Independence is a direct outgrowth of modularity and the concepts of
abstraction and information hiding.
Design software so that each module addresses a specific sub-function of requirements and has a
simple interface when viewed from other parts of the program structure.
Functional independence is a key to good design, and design is the key to software quality.
Independence is assessed using two qualitative criteria: cohesion and coupling.
Coupling is a qualitative indication of the degree to which a module is connected to other modules
and to the outside world “lowest possible”.
9-6 SEPA, 6/e Instructor’s Guide
Refinement
It is the elaboration of detail for all abstractions. It is a top down strategy. A program is developed
by successfully refining levels of procedural detail.A hierarchy is developed by decomposing a
macroscopic statement of function (a procedural abstraction) in a stepwise fashion until
programming language statements are reached.
Refactoring
It is a reorganization technique that simplifies the design of a component without changing its
function or behavior. When software is re-factored, the existing design is examined for
redundancy, unused design elements, inefficient or unnecessary algorithms, poorly constructed
data structures, or any other design failures that can be corrected to yield a better design.
Data Abstraction
Procedural Abstraction
Software Design
“The overall structure of the software and the ways in which that structure provides
conceptual integrity for a system.”
Modular Design
Modularity: Trade-offs
Information Hiding
9-8 SEPA, 6/e Instructor’s Guide
Stepwise Refinement
Functional
Independe
nce
MODULE
Software Design
Refactoring
Design classes
As the design model evolves, the software team must define a set of design classes that refines
the analysis classes and creates a new set of design classes.
Five different classes’ types are shown below:
1. User Interface classes: define all abstractions that are necessary for HCI.
2. Business domain classes: are often refinements of the analysis classes defined earlier. The
classes identify the attributes and services that are required to implement some element of
the business domain.
3. Process classes: implement lower-level business abstractions required to fully manage the
business domain classes.
4. Persistent classes: represent data stores that will persist beyond the execution of the
software.
5. System classes: implement software management and control functions that enable the
system to operate and communicate within its computing environment and with the outside
world.
high
analysis model
class diagrams
analysis packages
use-cases - text class diagrams
Requirements:
CRC models use-case diagrams constraints
analysis packages
collaboration diagrams
activity diagrams CRC models interoperability
data flow diagrams swim lane diagrams collaboration diagrams targets and
control-flow diagrams collaboration diagrams data flow diagrams
processing narratives state diagrams control-flow diagrams
configuration
sequence diagrams processing narratives
state diagrams
sequence diagrams
process dimension
MobilePhone
WirelessPDA
Cont rolPanel
LCDdisplay
LEDindicators
keyPadCharacteristics K eyPad
speaker
wirelessInterf ace
readKeyStroke()
decodeKey ()
displayStatus()
lightLEDs()
sendControlMsg()
readKeystroke()
decodeKey()
It is equivalent to a set of detailed drawings and specs for each room in a house.
The component-level design for software fully describes the internal detail of each software
component.
Indicates how software functionally and subsystem terms will be allocated within the
physical computing environment that will support the software.
9-12 SEPA, 6/e Instructor’s Guide
The best designers in any field have an ability to see patterns that characterize a problem
and corresponding patterns that can be combined to create a solution. Throughout design
process s/w eng should look for every opportunity to reuse existing design patterns(when
they meet needs of design) rather than creating new ones.
Once the analysis model has been developed, the designer can examine a detailed representation
of the problem to be solved and the constraints that are imposed by the problem.
Architectural patterns:
These patterns define the overall structure of the software, indicate the relationships among
subsystems and software components, and define the rules for specifying relationships among the
elements (classes, packages, components, subsystems) of the architecture.
Design patterns: These patterns address a specific element of the design such as an aggregation
of components to solve some design problems, relationships among components, or the
mechanisms for effecting component-to-component communication.
Idioms: Sometimes called coding patterns, these language-specific patterns generally implement
an algorithmic element of a component, a specific interface protocol, or a mechanism for
communication among components.