CSE320 - Unit2 - 1 MODULARITY
CSE320 - Unit2 - 1 MODULARITY
Software Design
Table of Content
• Software design Overview
2
3
Software Design
The design phase of software development deals with transforming the customer
requirements as described in the SRS documents into a form implementable using
a programming language.
4
S/W Design
Design
SRS DOCUMENT Activities DESIGN DOCUMENT
5
Why S/w Design ???
• Modularity
• Scalability
• Maintainability
• Abstraction
• Encapsulation
• Reusability
• Cohesion
• Loose Coupling
• Agility
• Testability
6
Traditional Design Approach
Consists of two activities:
• Structured analysis
• Structured design
7
Software Design Overview
• Definition: Process of transforming user requirements into a form suitable for coding
and implementation.
8
Cont. S/w Design
Design phase transforms SRS document:
into a form easily implementable in some programming language.
Initially blueprint shows how the software will look and what kind of data or
components will be required to in making it.
9
Process of s/w Design
• During design process, the s/w specifications are transformed into design models.
• Each design product is reviewed for quality before moving to the next phase of
the s/w development
• At the end of the process the design model and specification document is
produced.
10
Importance of the Design Phase
• Provides a clear blueprint for developers.
11
Objectives of Software Design
Understandability: Modular design ensures easy understanding
12
Levels of Software Design
• Architectural Design: Defines overall system structure and components.
13
Contd. (Levels of Software Design)
• High-Level Design: Decomposes problems into manageable modules.
14
Design Specification Models
• Data Design: Created by transforming the analysis information model(data dictionary
and ERD) into data structures required to implement the s/w.
• Architectural design: defines the relationships among the major structured elements of
the software, the design patterns
That can be used to achieve the requirements that have been defined for the system.
Relationships can be made using UML or USECASE diagrams.
• Interface Design: describes how the software elements communicate with each other,
with other systems, and with human users; the data flow and control flow diagrams
provide the much of the necessary information required
15
Classification of Design Activity
Design activities are usually classified into two stages:
1. Preliminary (or high-level) design
2. Detailed design
17
Items Designed During Design
Phase
1. module structure
18
Module in Software Design
• Definition: A module refers to a self-contained unit or component of a program that performs a specific task
or set of tasks.
• Modules are designed to break down complex systems into smaller, manageable parts, promoting modularity
and reusability.
• Each module typically has a well-defined interface, making it easier to interact with other modules while
encapsulating its internal functionality
20
Module structure
A module consists of:
1. several functions
2. associated data structures
21
Basic issues in software design
• Modularity
• Coupling
• Cohesion
Identify:
1. Modules
2. Control relationships among modules
3. Interfaces among modules
22
Modularity
Modularity is a fundamental attribute of any good design.
• Software is divided into the different modules or functions. Further we have various
attributes. So these modules should have less dependency to each other.
23
Contd… In technical terms, modules should display:
1. high cohesion
If modules are independent: 2. low coupling
modules can be understood separately.
For the better software design.
reduces the complexity greatly.
Dependencies
Note: reduce the high
High dependencies dependencies using the
design techniques
24
Why modularize a System?
• Management: Partition the overall development effort.
• Evolution: Decouple parts of system so that changes to one part are isolated from
changes to other part
Principle of Discontinuity(delete a part)
Principle of Continuity(Addition to the part)
25
Advantage of Modularization
• Smaller components are easier to maintain
26
Cohesion (intra module)
• Cohesion represent the detail design (within module, how elements
are interrelating to each other)
• Cohesion means togetherness or group within the module.
• How we are grouping the various functions/ various methods inside
the module.
27
Coupling (inter module)
• Dependency between two or more modules.
• It measure the degree of interdependence between modules.
• A good software will have low coupling.
28
Cohesion and Coupling
Cohesion Coupling
• Cohesion is intra module. • Coupling is inter module,
between two or more modules.
• It is the measure of functional
strength of the modules. • A measure of the degree of
interdependence or interaction
• A cohesive modules performs a between the two modules.
single task or function.
29
Types of coupling
Dependency between two or more modules.
If modules are more inter related means they are highly interdependent to each other.
So debugging or error isolation will become difficult in the particular module.
30
How modules become coupled/dependent?
When module share data/ exchange data or they make calls to each
other.
31
Types of cohesion
Cohesion (intra module)
• Cohesion represent the detail
Best design (within module, how
elements are interrelating to each
other)
• Cohesion means togetherness
or group within the module.
• How we are grouping the
various functions/ various
methods inside the module.
32
Coincidental Cohesion:
• Definition: Elements are grouped arbitrarily without a clear
relationship.
• Example: A module performing unrelated tasks.
• Impact: Leads to low maintainability and poor design.
33
Logical Cohesion:
• Definition: Elements perform similar tasks but execute based on a
control variable.
• Example: A module with functions for printing different formats
based on an input parameter.
• Impact: Improves cohesion slightly but is still not ideal.
34
Temporal Cohesion:
• Definition: Elements are related by timing, executed together.
• Example: Initialization tasks in a startup module.
• Impact: Useful but limited maintainability.
35
Procedural Cohesion:
36
Communicational Cohesion:
37
Sequential Cohesion:
•Definition: Elements output data that serves as input for the next element.
•Example: A module where step 1 generates data for step 2.
•Impact: Strong cohesion, ensures logical flow.
38
Functional Cohesion (Highest Level):
39
Characteristics of Module Structure
• Module structure in programming refers to how a program is organized into distinct, self-contained units or
modules, each responsible for a specific part of the functionality. Key characteristics of module structure
include:
• Encapsulation: Each module is designed to focus on a specific responsibility, hiding its internal workings (data
and implementation details) from other modules. This makes modules reusable and easier to understand.
• Separation of Concerns: By dividing a system into modules, each module can address a specific concern or
functionality, promoting cleaner and more maintainable code.
• Interdependency: While modules are independent in functionality, they often interact with one another to
form the complete application. The dependencies between modules should be minimal to avoid tightly
coupled code.
• Reusability: Modules are designed to be reusable in different contexts, reducing redundancy and promoting
efficiency. A well-structured module can be imported into different programs without modification.
• Maintainability: A modular structure makes the codebase easier to maintain. Since each module is
independent, developers can update, fix, or enhance individual modules without affecting the entire system.
40
Quick Test
1. Which document is transformed during the software design phase?
A. Test Plan Document
B. SRS Document
C. Project Charter
D. User Manual
2. What is the primary objective of software design?
A. To debug the software
B. To define the hardware requirements
C. To create a blueprint for implementation
D. To monitor the software process
41
3. Which level of design identifies the overall structure of the system?
A. Architectural Design
B. High-Level Design
C. Detailed Design
D. Functional Design
44