unit III-SE
unit III-SE
unit III-SE
Software design encompasses the set of principles, concepts, and practices that lead to the
development of a high-quality system or product. Design principles establish an overriding philosophy
that guides you in the design work you must perform. Design concepts must be understood before the
mechanics of design practice are applied, and design practice itself leads to the creation of various
representations of the software that serve as a guide for the construction activity.
DESIGN PROCESS
Software design consists of the set of principles, concepts, and practices which is used for
developing the system or product
Software design is an iterative process through which requirements are translated into a
blueprint for constructing the software
1
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.
Quality Guidelines
A design should exhibit an architecture that is created using recognizable architectural styles or
patterns and composed of components that exhibit good design characteristics and can be
implemented in an evolutionary fashion
A design should be modular
A design should contain distinct representations of data, architecture, interfaces, and
components.
A design should lead to data structures that are appropriate for the classes to be implemented
and are drawn from recognizable data patterns.
A design should lead to components that exhibit independent functional characteristics.
A design should lead to interfaces that reduce the complexity of connections between
components and with the external environment.
A design should be derived using a repeatable method that is driven by information obtained
during software requirements analysis.
A design should be represented using a notation that effectively communicates its meaning.
Design Principles
The design process should not suffer from ‘tunnel vision.’
The design should be traceable to the analysis model.
The design should exhibit uniformity and integration.
The design should be structured to accommodate change.
The design should be structured to degrade gently, even when aberrant data, events, or
operating conditions are encountered.
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 semantic errors.
Quality Attributes. [FURPS]
Functionality is assessed by evaluating the feature set and capabilities of the program and the
security of the overall system etc.
2
Reliability is evaluated by measuring the frequency and severity of failure, the mean- time-to-
failure (MTTF), the ability to recover from failure etc.
Performance is measured by considering processing speed, response time, resource
consumption, throughput, and efficiency.
Supportability combines the ability to extend the program (extensibility), adaptability,
serviceability
The Evolution of Software Design
Early design work concentrated on criteria for the development of modular programs and
methods for refining software structures in a top down manner.
Procedural aspects of design definition evolved into structured programming
Later work proposed methods for the translation of data flow into a design definition.
Newer design approaches proposed an object-oriented approach to design derivation.
The design patterns can be used to implement software architectures and lower levels of design
abstractions.
Aspect-oriented methods, model-driven development, and test-driven development emphasize
techniques for achieving more effective modularity and architectural structure in the designs.
Characteristics of design methods:
(1) A mechanism for the translation of the requirements model into a design representation,
(2) A notation for representing functional components and their interfaces,
(3) Heuristics for refinement and partitioning, and
(4) Guidelines for quality assessment.
DESIGN CONCEPTS
Concepts that has to be considered while designing the software are:
Abstraction, Modularity, Architecture, pattern, Functional independence, refinement,
information hiding, refactoring and design classes
1. Abstraction
There are many levels of abstraction
At the highest level of abstraction, a solution is stated in broad terms and at lower levels of
abstraction, a more detailed description of the solution is provided.
Types:
Procedural abstraction refers to a sequence of instructions that have a specific and limited
function
Example: open for a door. Open implies a long sequence of procedural steps (e.g., walk to
3
the door, reach out and grasp knob, turn knob and pull door, step away from moving door,
etc.).
Data abstraction is a named collection of data that describes a data object
Eg: Data abstraction for door would encompass a set of attributes that describe the door (e.g.,
door type, swing direction, opening mechanism, weight, dimensions).
2. Architecture
Software architecture is the overall structure of the software and the ways in which that
structure provides conceptual integrity for a system
Properties:
Structural properties. This representation defines the components of a system and how they
interact with one another.
Extra-functional properties. The architectural design should address how the design
architecture achieves requirements for performance, capacity, reliability, security, adaptability.
Families of related systems. The architectural design should draw upon repeatable patterns that
are commonly encountered in the design of families of similar systems
Models to represent the Architectural design:
Structural models represent architecture as an organized collection of program components.
Framework models increase the level of design abstraction by attempting to identify repeatable
architectural design frameworks that are encountered in similar types of applications.
Dynamic models address the behavioural aspects of the program architecture, indicating how the
structure changes when an external event occurs.
Process models focus on the design of the business or technical process that the system must
accommodate.
Functional models can be used to represent the functional hierarchy of a system.
A number of different architectural description languages (ADLs) have been developed to
represent these models
3. Patterns
Design pattern is a design structure that solves a particular design problem within a specific
context
It provides a description to determine whether the pattern is applicable, whether the pattern can
be reused, and whether the pattern can serve as a guide for developing similar patterns
Separation of Concerns
Any complex problem can be more easily handled by subdividing it into pieces which can be
4
solved independently
A concern is a feature or behavior that is specified as part of the requirements model for the
software
By separating concerns into smaller manageable pieces, a problem takes less effort and time to
solve.
Modularity
Modularity is the single attribute of software that allows a program to be intellectually
manageable
Module is a separately named and addressable components that are integrated to satisfy
requirements (divide and conquer principle)
4. Information Hiding
Information hiding is that the algorithms and local data contained within a module are
inaccessible to other modules
5. Functional Independence
Functional independence is achieved by developing modules that have a "single-minded"
function having less interaction with other modules
Independent modules are easier to maintain and test and error propagation is also reduced.
Independence is assessed using two qualitative criteria: cohesion and coupling.
Cohesion is an indication of the relative functional strength of a module.
Coupling is an indication of the relative interdependence among modules.
A module should have high cohesion and low coupling
High cohesion – a module performs only a single task
Low coupling – a module has the lowest amount of connection needed with other modules
6. Refinement
Refinement is a process of elaboration
It is the development of a program by successively refining levels of procedure detail
This complements abstraction, which enables a designer to specify procedure and data and
suppress low-level details
Refinement helps to reveal low-level details as design progresses.
Aspects
An aspect is a representation of a cross-cutting concern
These concerns include requirements, use cases, features, data structures, quality-of- service
issues, variants, intellectual property boundaries, collaborations, patterns and contracts
5
7. Refactoring
Refactoring is a reorganization technique that simplifies the design of a component without
changing its function or external behaviour
It removes redundancy, unused design elements, inefficient or unnecessary algorithms, poorly
constructed or inappropriate data structures, or any other design failures
DESIGN MODEL
The design model can be viewed in two different dimensions
– (Horizontally) The process dimension indicates the evolution of the parts of the design
model as each design task is executed
– (Vertically) The abstraction dimension represents the level of detail as each element of
the analysis model is transformed into the design model and then iteratively refined
Elements of the design model use many of the same UML diagrams used in the analysis model
– The diagrams are refined and elaborated as part of the design
– More implementation-specific detail is provided
6
DESIGN ELEMENTS
1. Data/class design elements
Data design creates a model of data and objects that is represented at a high level of abstraction
This data model is then refined into progressively more implementation-specific representations
At the program component level, the design of data structures and the associated algorithms are
used for the creating the high-quality applications.
At the application level, the translation of a data model into a database is essential to achieve the
business objectives of a system.
At the business level, the collection of information stored in different databases and reorganized into
a data warehouse enables data mining or knowledge discovery.
2. Architectural design elements
Architectural design depicts the overall layout of the software
The architectural model is derived from three sources:
(1) Information about the application domain
(2) Specific requirements model elements such as data flow diagrams and their relationships
(3) The availability of architectural styles and patterns.
The architectural design element is usually represented as a set of interconnected subsystems, each
have its own architecture
3. Interface design elements
Interface design tells how information flows into and out of the system and how it is communicated
among the various components of the architecture
Elements of interface design:
o user interface,
o external interfaces, and
o internal interfaces.
UI design (called as usability design) incorporates aesthetic elements (e.g., layout, color, graphics,
interaction mechanisms), ergonomic elements (e.g., information layout and placement, metaphors,
7
UI navigation), and technical elements (e.g., UI patterns, reusable components).
External interface design requires information about the entity to which the information is
communicated. The design should incorporate error checking and security features.
Internal interface design is related with component-level design. Design realizations represent all
operations and the messaging schemes required to enable communication and collaboration between
operations in various classes.
4. Component-level design elements
Component level design describes the internal detail of each software component like data structure
definitions, algorithms, and interface specifications.
A UML activity diagram can be used to represent processing logic.
Pseudocode or some other diagrammatic form (e.g., flowchart or box diagram) is used to represent
the detailed procedural flow between the component.
Algorithmic structure follows the rules established for structured programming
E.g.
8
DESIGN HEURISTIC
1. Evaluate the first iteration of the program structure to reduce the coupling and improve
cohesion
The module independency can be achieved by exploding or imploding the modules
Exploding means obtaining more than one modules in the final stage
Imploding means combining the results of different modules
2. Attempt to minimize the structures with high fan-out and strive for fan-in as depth increases
At the higher level of program structure the distribution of control should be made.
Fan in means number of immediate ancestors the modules have
Fan –out means number of immediate subordinates to the module.
3. Keep scope of the effect of a module within the scope of control of that module
The decisions made in one module should not affect the other module which is not inside its scope
4. Evaluate the module interfaces to reduce complexity and redundancy and improve consistency
The major cause of errors is module interfaces. They should simply pass the information and should be
consistent with the module
5. Define module whose function is predictable but avoid modules that are too restrictive
The modules should be designed with simple processing logics and should not restrict the size of the
local data structure, control flow or modes of external interfaces
6. Strive for controlled entry modules by avoiding pathological connections
Interfaces should be constrained and controlled. Pathological connection means many references or
branches into the middle of the module
9
ARCHITECTURAL DESIGN
The software architecture is the overall structure of the system which is includes the software
components , their properties and the relationships among the components
Software architectural design represents the structure of the data and program components that are
required to build a computer-based system
An architectural design model is transferable
o It can be applied to the design of other systems
o It represents a set of abstractions that enable software engineers to describe architecture in predictable
ways
For deriving the architecture, horizontal and vertical partitioning are required
Horizontal Partitioning
Horizontal Partitioning define separate branches of the module hierarchy for each major function
This use control modules to coordinate communication between functions
Eg:
ARCHITECTURAL MAPPING
Structured design provides a convenient transition from a data flow diagram to software
Architecture
b g h
a e f
d
c i
j
data flow model
"Transform" mapping
e g i
h j
Eg:
Step 5. Perform “first-level factoring”
o Program structure represents a top-down distribution control.
o factoring results in a program structure(top-level, middle-level, low-level)
o Number of modules limited to minimum.
Eg:
Step 7. Refine the first iteration program structure using design heuristics for improved
software quality.
Eg: class Withdraw can include the attributes like account no, name, balance and
functions like withdraw() and update() etc
Workflow analysis
Workflow analysis defines how a work process is completed when several people are involved
For work flow analysis swimlane diagram is used
Eg:
Hierarchical representation
Once workflow has been established, a task hierarchy can be defined for each user type.
The hierarchy is derived by a stepwise elaboration of each task identified for the user
Analysis of Display Content
This phase is about analyzing how to present the variety of contents
The display content may range from character-based reports (e.g Spreadsheet), to graphical
displays(e.g : histogram,3D model etc), to multimedia information(e.g Audio or video)
Display content may be
o Generated by components in other parts of the application
o Acquired from data stored in a database that is accessible from the application
o Transmitted from systems external to the application in question
Sample questionnaire for content analysis
o Are different types of data assigned to consistent geographic locations on the screen?
o Can the user customize the screen location for content?
o Will graphical output be scaled to fit within the bounds of the display device that is
used?
o How will color to be used to enhance understanding?
o How will error messages and warning be presented to the user?
Work Environment Analysis
Software products need to be designed to fit into the work environment, otherwise they may be
difficult or frustrating to use
Factors to consider include
o Type of lighting
o Display size and height
o Keyboard size, height and ease of use
o Mouse type and ease of use
o Surrounding noise
o Space limitations for computer and/or user
o Weather or other atmospheric conditions
o Temperature or pressure restrictions
o Time restrictions (when, how fast, and for how long)
INTERFACE DESIGN
User interface design is an iterative process, where each iteration elaborate and refines the
information developed in the preceding step
Steps involved in user interface design
1. Define user interface objects and actions from the information collected in the analysis
phase
2. Define events that will cause the state of the user interface to change and model the
behavior
3. Depict each interface state as it will actually look to the end user
4. Indicate how the user interprets the state of the system from information provided
through the interface
Applying Interface Design steps
Interface objects and actions are obtained from a grammatical parse of the use cases and the
software problem statement
Interface objects are categorized into 3 types: source, target, and application
o A source object is dragged and dropped into a target object such as to create a
hardcopy of a report
o An application object represents application-specific data that are not directly
manipulated as part of screen interaction such as a list
After identifying objects and their actions, an interface designer performs screen layout which
involves
o Graphical design and placement of icons
o Definition of descriptive screen text
o Specification and titling for windows
o Definition of major and minor menu items
o Specification of a real-world metaphor to follow
User Interface Design Patterns
A design pattern is an abstraction that prescribes a design solution to a specific, well- bounded
design problem.
Eg:
o CalendarStrip that produces a continuous, scrollable calendar in which the current date
is highlighted and future dates may be selected by picking them from the calendar.
Design Issues
Four common design issues in any user interface
o System response time (both length and variability)
Length is the amount of time taken by the system to respond.
Variability is the deviation from average response time
o User help facilities
Help facilities gives information about when is it available, how is it accessed, how is
it represented to the user, how is it structured, what happens when help is exited
Eg: user manuals or online help facilities
o Error information handling
Error messages and warnings should describe the problem
It should provide constructive advice for recovering from the error
It should indicate negative consequences of the error etc
This messages helps to improve the quality of an interactive system and will
significantly reduce user frustration when problems do occur
o Menu and command labeling
Menu and command labeling should be consistent, easy to learn
Questions for menu labeling
1. Will every menu option have a corresponding command?
2. What can be done if a command is forgotten?
3. Can commands be customized or abbreviated by the user?
o Application accessibility
Software engineers must ensure that interface design encompasses
mechanisms that enable easy access for those with special needs.
o Internationalization
The challenge for interface designers is to create “globalized” software.
That is, user interfaces should be designed to accommodate a generic core of
functionality that can be delivered to all who use the software.
Localization features enable the interface to be customized for a specific market.
Cohesion
Cohesion is the “single-mindedness’ of a component
It implies that a component or class encapsulates only attributes and operations that are closely
related to one another and to the class or component itself
The objective is to keep cohesion as high as possible
The kinds of cohesion can be ranked in order from highest (best) to lowest (worst)
o Functional
Exhibited primarily by operations
This level of cohesion occurs when a component performs a targeted
computation and then returns a result.
o Layer
Exhibited by packages, components, and classes,
Eg: