0% found this document useful (0 votes)
13 views12 pages

Software Design

Software design is the process of transforming user requirements into a structured format that aids in coding and implementation, focusing on correctness, completeness, efficiency, flexibility, consistency, and maintainability. Key principles include problem partitioning, abstraction, and modularity, which help manage complexity and improve the design's effectiveness. Coupling and cohesion are critical concepts in software design, where low coupling reduces interdependencies between modules and high cohesion ensures that module elements are closely related in functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views12 pages

Software Design

Software design is the process of transforming user requirements into a structured format that aids in coding and implementation, focusing on correctness, completeness, efficiency, flexibility, consistency, and maintainability. Key principles include problem partitioning, abstraction, and modularity, which help manage complexity and improve the design's effectiveness. Coupling and cohesion are critical concepts in software design, where low coupling reduces interdependencies between modules and high cohesion ensures that module elements are closely related in functionality.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

SOFTWARE DESIGN

 Software design is a mechanism to transform user requirements into some suitable


form, which helps the programmer in software coding and implementation.
 It deals with representing the client's requirement, as described in SRS (Software
Requirement Specification) document, into a form, i.e., Software Design
Specification (SDS) or Software Design Document (SDD) which can be easily
implemented using programming language.
 It moves the concentration from the problem domain to the solution domain.
 In software design, we consider the system to be a set of components or modules
with clearly defined behaviors & boundaries.

Objectives of Software Design

Following are the purposes 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.

Software Design Principles

Software design principles are concerned with providing means to handle the
complexity of the design process effectively.

Effectively managing the complexity will not only reduce the effort needed for design
but can also reduce the scope of introducing errors during design.

Following are the principles of Software Design


1. Problem Partitioning

For small problem, we can handle the entire problem at once; but for any
big/complex/ significant problem, a principle called divide the problems and
conquer on it if followed where the problem is divided into smaller meaningful and
manageable pieces so that each piece can be captured separately.

Benefits of Problem Partitioning


1. Software is easy to understand
2. Software becomes simple
3. Software is easy to test
4. Software is easy to modify
5. Software is easy to maintain
6. Software is easy to expand

NOTE: The entire pieces after partitioning cannot be entirely independent of each other
as they together form the system. They have to cooperate and communicate each other
to solve the problem that results in complexity.

2. Abstraction

An abstraction is a tool that enables a designer to consider a component at an


abstract level without bothering about the internal details of the implementation.
There are two common abstraction mechanisms

1. Functional Abstraction
2. Data Abstraction

 Functional Abstraction
i. A module is specified by the method it performs.
ii. The details of the algorithm to accomplish the functions are not visible to the
user of the function.

Functional abstraction forms the basis for Function oriented design approaches.
 Data Abstraction

Details of the data elements are not visible to the users of data. Data Abstraction
forms the basis for Object Oriented design approaches.

3. Modularity

 Modularity specifies to the division of software into separate modules which are
differently named and addressed and are integrated later on in to obtain the
completely functional software.
 It is the only property that allows a program to be intellectually manageable.
 Single large programs are difficult to understand and read due to a large
number of reference variables, control paths, global variables, etc.

The desirable properties of a modular system are:

o Each module is a well-defined system that can be used with other applications.
o Each module has single specified objectives.
o Modules can be separately compiled and saved in the library.
o Modules should be easier to use than to build.
o Modules are simpler from outside than inside.

Advantages of Modularity

There are several advantages of Modularity

o It allows large programs to be written by several or different people


o It encourages the creation of commonly used routines to be placed in the library
and used by other programs.
o It simplifies the overlay procedure of loading a large program into main storage.
o It provides more checkpoints to measure progress.
o It provides a framework for complete testing, more accessible to test
o It produced the well designed and more readable program.

Disadvantages of Modularity

There are several disadvantages of Modularity

o Execution time maybe, but not certainly, longer


o Storage size perhaps, but is not certainly, increased
o Compilation and loading time may be longer
o Inter-module communication problems may be increased
o More linkage required, run-time may be longer, more source lines must be
written, and more documentation has to be done
Modular Design

Modular design reduces the design complexity and results in easier and faster
implementation by allowing parallel development of various parts of a system.

i. Functional Independence:

 Functional independence is achieved by developing functions that perform


only one kind of task and do not excessively interact with other modules.
 Independence is important because it makes implementation more
accessible and faster.
 The independent modules are easier to maintain, test, and reduce error
propagation and can be reused in other programs as well.

It is measured using two criteria:

o Cohesion: It measures the relative functional strength of a module.


o Coupling: It measures the relative interdependencies among modules.

ii. Information hiding:

 The fundamental of Information hiding suggests that modules should be


specified that data include within a module is inaccessible to other modules
that do not need for such information.

 The use of information hiding as design criteria for modular system provides
the most significant benefits when modifications are required during testing
and later during software maintenance.
 This is because as most data and procedures are hidden from other parts of the
software.

Strategy of Design

 A good system design strategy is to organize the program modules in such a


method that are easy to develop and to modify at later requirements.
 Structured design methods help developers to deal with the size and complexity
of programs. Analysts generate instructions for the developers about how code
should be composed and how pieces of code should fit together to form a
program.

To design a system, there are two possible approaches:

1. Top-down Approach
2. Bottom-up Approach

Top-down Approach:

 Top-Down Approach is an approach to design algorithms in which a


bigger problem is broken down into smaller parts. (decomposition)
 This approach starts with the identification of the main components and
then decomposing them into their more detailed sub-components.
 The implementation of algorithm using top-down approach depends on
the programming language and platform.
 It does not require communication between modules.
 Preferred in Structured Oriented Design using programming languages
such as C, COBOL, and FORTRAN etc.

Bottom-up Approach:

 A bottom-up approach begins with the lower details and moves towards
up the hierarchy, as shown in fig.
 The smaller problems are solved, and then these solved problems are
integrated to find the solution to a bigger problem.
 It uses composition approach
 It requires relatively more communication between modules.
 Data encapsulation and data hiding is implemented in this approach.
 Highly preferred in OOPs; programming paradigm such as C++, Java,
Python, etc.

COUPLING AND COHESION

 The coupling is the degree of interdependence between software modules.


 Two modules that are tightly coupled are strongly dependent on each other.
However, two modules that are loosely coupled are not dependent on each
other.
 Uncoupled modules have no interdependence at all within them.

The various types of coupling techniques:

 A good design is the one that has low coupling.


 Coupling is measured by the number of relations between the modules. That is,
the coupling increases as the number of calls between modules increase or the
amount of shared data is large.
 Thus, a design with high coupling will have more errors.

Types of Module Coupling

1. No Direct Coupling:

There is no direct coupling between M1 and M2modules.

In this case, modules are subordinates to different modules. Therefore, no direct


coupling is observed.
2. 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 of each other and
communicate through data. Module communications don’t contain tramp data.

Example - customer billing system.

3. Stamp Coupling:

 Two modules are stamp coupled if they communicate using composite data
items such as structure, objects, etc.

 When the module passes non-global data structure or entire structure to


another module, they are said to be stamp coupled. For example, passing
structure variable in C or object in C++ language to a module.

4. Control Coupling: Control Coupling exists among two modules if data from one
module is used to direct the structure of instruction execution in another.

5. External Coupling: External Coupling arises when two modules share an


externally imposed data format, communication protocols, or device interface. This is
related to communication to external tools and devices.
6. Common Coupling:

 Two modules are common coupled if they share information through some
global data items.
 The changes in global data mean tracing back to all modules which access that
data to evaluate the effect of the change.

7. Content Coupling:

 Content Coupling exists among two modules if they share code, e.g., a branch
from one module into another module.
 One module can modify the data of another module, or control flow is passed from
one module to the other module.

8. Temporal Coupling:

 Temporal coupling occurs when two modules depend on the timing or order of
events, such as one module needing to execute before another.
 This type of coupling can result in design issues and difficulties in testing and
maintenance.
9. Sequential Coupling:

 Sequential coupling occurs when the output of one module is used as the
input of another module, creating a chain or sequence of dependencies.
 This type of coupling can be difficult to maintain and modify.

10. Communicational Coupling:

 Communicational coupling occurs when two or more modules share a


common communication mechanism, such as a shared message queue or
database.
 This type of coupling can lead to performance issues and difficulty in
debugging.

11. Functional Coupling:

 Functional coupling occurs when two modules depend on each other’s


functionality, such as one module calling a function from another module.
 This type of coupling can result in tightly-coupled code that is difficult to
modify and maintain.

12. Data-Structured Coupling:

 Data-structured coupling occurs when two or more modules share a common


data structure, such as a database table or data file.
 This type of coupling can lead to difficulty in maintaining the integrity of the
data structure and can result in performance issues.

Module Cohesion

 Cohesion defines to the degree to which the elements of a module belong


together.
 Cohesion measures the strength of relationships between pieces of functionality
within a given module.

For example, in highly cohesive systems, functionality is strongly related.


Types of Modules Cohesion

1. Functional Cohesion: Functional Cohesion is said to exist if the different


elements of a module, cooperate to achieve a single function.
2. Sequential Cohesion: A module is said to possess sequential cohesion if the
element of a module form the components of the sequence, where the output
from one component of the sequence is input to the next.
3. Communicational Cohesion: A module is said to have communicational
cohesion, if all tasks of the module refer to or update the same data structure,
e.g., the set of functions defined on an array or a stack.
4. Procedural Cohesion: A module is said to be procedural cohesion if the set of
purpose of the module are all parts of a procedure in which particular sequence
of steps has to be carried out for achieving a goal, e.g., the algorithm for
decoding a message.
5. Temporal Cohesion: When a module includes functions that are associated by
the fact that all the methods must be executed in the same time, the module is
said to exhibit temporal cohesion.
6. Logical Cohesion: A module is said to be logically cohesive if all the elements of
the module perform a similar operation. For example Error handling, data input
and data output, etc.
7. Coincidental Cohesion: A module is said to have coincidental cohesion if it
performs a set of tasks that are associated with each other very loosely, if at all.
Differentiate between Coupling and Cohesion

Coupling Cohesion

Coupling is also called Inter-Module Binding. Cohesion is also called Intra-Module Binding.

Coupling shows the relationships between Cohesion shows the relationship of elements within
modules.(Dependency) the module.(Independence)

Coupling shows the relative Cohesion shows the module's


dependency between the modules. relative functional strength.

While creating, it is preferred aim for low While creating or designing modules, it is preferred
coupling, i.e., dependency among modules to aim for high cohesion, i.e., a cohesive
should be less. component/ module focuses on a single function
(i.e., single-mindedness) with little interaction with
other modules of the system.

In coupling, modules are linked to the other In cohesion, the module focuses on a single thing.
modules.

Advantages of low coupling:

 Improved maintainability: Low coupling reduces the impact of changes in one


module on other modules, making it easier to modify or replace individual
components without affecting the entire system.
 Enhanced modularity: Low coupling allows modules to be developed and tested
in isolation, improving the modularity and reusability of code.
 Better scalability: Low coupling facilitates the addition of new modules and the
removal of existing ones, making it easier to scale the system as needed.

Advantages of high cohesion:

 Improved readability and understandability: High cohesion results in clear,


focused modules with a single, well-defined purpose, making it easier for
developers to understand the code and make changes.
 Better error isolation: High cohesion reduces the likelihood that a change in one
part of a module will affect other parts, making it easier to isolate and fix errors.
 Improved reliability: High cohesion leads to modules that are less prone to
errors and that function more consistently, leading to an overall improvement
in the reliability of the system.

Disadvantages of high coupling:

 Increased complexity: High coupling increases the interdependence between


modules, making the system more complex and difficult to understand.
 Reduced flexibility: High coupling makes it more difficult to modify or replace
individual components without affecting the entire system.
 Decreased modularity: High coupling makes it more difficult to develop and test
modules in isolation, reducing the modularity and reusability of code.

Disadvantages of low cohesion:

 Increased code duplication: Low cohesion can lead to the duplication of code, as
elements that belong together are split into separate modules.
 Reduced functionality: Low cohesion can result in modules that lack a clear
purpose and contain elements that don’t belong together, reducing their
functionality and making them harder to maintain.
 Difficulty in understanding the module: Low cohesion can make it harder for
developers to understand the purpose and behavior of a module, leading to
errors and a lack of clarity.

You might also like