You are on page 1of 47

UNIT -4

Software Design
Introduction
+ Software design is an iterative process through which
requirements are translated into a blueprint for
constructing the software.
+ It consist of set of principles, concepts and practices
that lead to the development of high quality system

2
Objectives of Software Design

3
Objectives of Software Design
1. Correctness: Software design should be correct as per
requirement.
2. Completeness: The design should have all components
like data structures, modules, and external interfaces, etc.
3. Efficiency: Resources should be used efficiently by the
program.
4. Flexibility: Able to modify on changing needs.
5. Consistency: There should not be any inconsistency in the
design.
6. Maintainability: The design should be so simple so that it
can be easily maintainable by other designers.
4
Software design principles
+ Software design principles are a set of
guidelines that helps developers to make a
good system design.
+ Software design principles are concerned with
providing means to handle the complexity of
the design process effectively.

5
Software design principles
Some of the commonly followed design principles are as
following:
1. Software design should correspond to the analysis
model
2. Choose the right programming paradigm
3. Software design should be uniform and integrated
4. Software design should be flexible

6
5. Software design principles
6. Software design should ensure minimal conceptual
(semantic) errors
7. Software design should be structured to degrade gently
8. Software design should represent correspondence
between the software and real-world problem
9. Software reuse
10. Designing for testability
11. Prototyping 7
Software Design Concepts
1. Abstraction: hide Irrelevant data
2. Architecture: design a structure of something
3. Pattern: a repeated form
4. Modularity: subdivide the system
5. Information hiding: hide the information
6. Refinement: removes impurities
7. Refactoring: reconstruct something
8. Structural partitioning: Structure of the program can be
partitioned
9. Concurrency: control the concurrent execution of process

8
Design Concepts – 1. Abstraction
+ Abstraction refers to a powerful design tool, which
allows software designers to consider components at
an abstract level, while neglecting the implementation
details of the components.
+ There are three commonly used abstraction
mechanisms in software design, namely, functional
abstraction, data abstraction and control abstraction.
+ All these mechanisms allow us to control the
complexity of the design process

9
Design Concepts – 1. Abstraction
1. Functional abstraction: It can be generalized as
collections of subprograms referred to as
‘groups’.
2. Data abstraction: This involves specifying data
that describes a data object.
3. Control abstraction: This states the desired
effect, without stating the exact mechanism of
control.

10
Design Concepts – 2. Architecture
+ Software architecture refers to the structure of the
system, which is composed of various components
of a program/ system, the properties of those
components and the relationship amongst them.
+ The software architecture enables the software
engineers to analyze the software design efficiently.
+ It also helps them in decision-making and handling
risks.

11
Design Concepts – 2. Architecture

The software architecture does the following:


1. Enable the stakeholder to communicate with
each other
2. Highlights the early design designs
3. Creates intellectual models

12
Design Concepts – 3. Pattern
+ The pattern simply means a repeated form or
design in which the same shape is repeated
several times to form a pattern.
+ The pattern in the design process means the
repetition of a solution to a common recurring
problem within a certain context.

13
Design Concepts – 4. Modularity
+ Modularity is achieved by dividing the software into
uniquely named and addressable components, which
are also known as modules.
+ Modularizing a design helps to plan the development
in a more effective manner, accommodate changes
easily, conduct testing and debugging effectively and
efficiently, and conduct maintenance work without
adversely affecting the functioning of the software.

14
Design Concepts – 4. Modularity

15
Design Concepts– 5.Information
hiding
+ Modules should be designed in such a way that the
data structures and processing details of one module
are not accessible to other modules.
+ They pass only that much information to each other,
which is required to accomplish the software
functions.
+ The way of hiding unnecessary details is referred to
as information hiding.
16
Design Concepts– 6. Refinement
+ Refinement simply means to refine something to
remove any impurities if present and increase the
quality of the software.
+ The refinement of software design is actually a
process of developing or presenting the software or
system in a detailed manner.
+ Refinement is very necessary to find out any error if
present and then to reduce it.

17
Design Concepts– 7. Refactoring
+ Refactoring means to reconstruct something in
such a way that it does not affect the behavior or
any other features.
+ Refactoring in software design means to
reconstruct the design to reduce complexity and
simplify it without affecting the behavior or its
functions.

18
Design Concepts– 8. Structural
partitioning
When the architectural style of a design follows a
+
hierarchical nature, the structure of the program can
be partitioned either horizontally or vertically.
1. Vertical partitioning: In this, the functionality is
distributed among the modules in a top-down
manner. The modules at the top level called control
modules that perform the decision-making and do
little processing whereas the modules at the low level
called worker modules that perform all input
computation and output tasks.
19
Design Concepts– 8. Structural
partitioning
2.Horizontal partitioning: In this, the control modules
are used to communicate between functions and
execute the functions.

20
Design Concepts– 8. Structural
partitioning
+Structural partitioning
benefits.
provides the following

• The testing and maintenance of software


becomes easier.
• The negative impacts spread slowly.
• The software can be extended easily.

21
Design Concepts– 9. Concurrency
+ To utilize the resources efficiently, multiple tasks
must be executed concurrently. This requirement
makes concurrency one of the major concepts of
software design.
+ Every system must be designed to allow multiple
processes to execute concurrently, whenever possible.
+ The system must control the concurrent execution
and synchronize the actions of concurrent processes.

22
Effective modular design
+ Effective modular design can be achieved if the
partitioned modules are separately solvable,
modifiable as well as easy to compile.

+ Here separate compilation of modules means that


after making changes in a module there is no need
of recompiling the whole software system.

23
Effective modular design
+ In order to build a software with effective modular
design there is a factor “Functional
Independence” which comes into play.
+ The Functional Independence means a function is
atomic in nature so that it performs only a single task
of the software without or with least interaction with
other modules.
+ Independence of modules of a software system can be
measured using 2 criteria : Cohesion, and Coupling.

24
Effective modular design

A good software design requires high cohesion and low coupling.


25
Cohesion
+ Cohesion is a measure of the
degree to which the elements
of the module are functionally
related.
+ It is the degree to which all
elements directed towards
performing a single task are
contained in the component.
+ A good software design will
have high cohesion.
26
Types of Cohesion
1. Functional Cohesion: Functional cohesion is said to
exist if different elements of a module cooperate to
achieve a single function.
2. Sequential Cohesion: An element outputs some data
that becomes the input for other element, i.e., data flow
between the parts.
3. Communicational Cohesion: Two elements operate on
the same input data or contribute towards the same
output data.

27
Types of Cohesion
4. Procedural Cohesion: components within module
ensure the order of execution. Actions are still weakly
connected and unlikely to be reusable.
5. Temporal Cohesion: This cohesion contains the code
for initializing all the parts of the system or lots of
different activities occur, all at time of initialization.

28
Types of Cohesion
6. Logical Cohesion: The elements are logically related
and not functionally. All the code for these functions is
in the same component. Operations are related, but the
functions are significantly different.
7. Coincidental Cohesion: The elements are not related
i.e., it performs a set of function or tasks that relate to
each other very loosely. The elements have no
conceptual relationship other than location in source
code. It is accidental and the worst form of cohesion.

29
Coupling
+ Coupling between two
modules is a measure of the
degree of interaction or
interdependence between the
two modules.
+ A module having low
coupling and high cohesion is
said to be functionally
independent of other
modules.
30
Types of Coupling
1. Data Coupling: If the dependency between the
modules is based on the fact that they communicate
by passing only data, then the modules are said to
be data coupled. In data coupling, the components
are independent to each other and communicating
through data.
2. Stamp Coupling: In stamp coupling, the complete
data structure is passed from one module to another
module.

31
Types of Coupling
3. Control Coupling: Control coupling exists between
two modules if data from one module is used to
direct the order of instructions executed in another.
An example of control coupling is a flag set in one
module and tested in another module.
4. External Coupling: In external coupling, the
modules depend on other modules, external to the
software being developed or to a particular type of
hardware.

32
Types of Coupling
5. Common Coupling: The modules have shared data
such as global data structures. The changes in global
data mean tracing back to all modules which access
that data to evaluate the effect of the change.
6. Content Coupling: In a content coupling, one
module can modify the data of another module or
control flow is passed from one module to the other
module. This is the worst form of coupling and
should be avoided.

33
Cohesion vs Coupling

34
Cohesion
vs
Coupling

35
Architectural Design-
Introduction
• The software needs the architectural design to
represents the design of software.
• Architectural
design represents the structure of data
and program components that are required to build a
computer-based system.
• It considers an architectural style, structure and
properties of the components and the interrelationships
that occur among all architectural components of a
system.
36
Architectural Design-
Introduction
• Architectural design begins with data design and then
proceeds to the derivation of one or more
representations of the architectural structure of the
system.
• Alternativearchitectural styles or patterns are analyzed
to derive the structure that is best suited to customer
requirements and quality attributes.
• Once an alternative has been selected, the architecture
is elaborated using an architectural design method.
37
Architectural Design – Software
architecture
• The software architecture of a program or computing
system is the structure of the system, which comprise
software components, the externally visible properties
of those components, and the relationships among
them.
• Architecturegenres, architecture styles, and patterns
can be applied to the design of the systems and it
enable software engineers to describe architecture in
predictable ways.

38
Architectural Design –
Architecture style
• Architecture style is a template to construct a
system.
• Thesoftware that is built for computer-based
systems exhibits one of many architectural
styles.

39
Architectural Design –
Architecture style
Each style describes a system category that encompasses:
1. A set of components that perform a function required
by a system
2. A set of connectors that enable “communication,
coordination and cooperation” among components
3. Constraints that define how components can be
integrated to form the system
4. Semantic models that enable a designer to understand
the overall properties of a system
40
Types of Architecture style
1. Data-centred architecture
2. Data flow architecture
3. Call and return architecture
4. Object-oriented architecture
5. Layered architecture

41
1. Data-centered architecture
A data store (e.g., a
file or a database)
resides at the center
of this architecture
and is accessed
frequently by other
components that
update, add, delete,
or otherwise modify
data within the store.

42
2. Data flow architecture
This architecture is applied when input data are to be
transformed through a series of computational or manipulative
components into output data.

43
3. Call and return architecture
This architectural style enables you to achieve a program
structure that is relatively easy to modify and scale.

44
4. Object-oriented architecture
• Inobject-oriented architectural style, components of
a system encapsulate data and operations, which are
applied to manipulate the data.
• Inthis style, components are represented as objects
and classes, and they interact with each other
through methods (connectors).

45
5. Layered architecture

46
5. Layered architecture
•A number of different layers are defined, each accomplishing
operations that progressively become closer to the machine
instruction set.
• Atthe outer layer, components service user interface
operations.
• Atthe inner layer, components perform operating system
interfacing.
• Intermediate
layers provide utility services and application
software functions.

47

You might also like