SlideShare a Scribd company logo
Cohesion and coupling
COUPLING
Coupling (computer programming)
 In software engineering, coupling is the degree of
interdependence between software modules; a
measure of how closely connected two routines or
modules are; the strength of the relationships between
modules.
 Coupling is usually contrasted with cohesion. Low
coupling often correlates with high cohesion, and vice
versa. Low coupling is often a sign of a well-
structured computer system and a good design, and
when combined with high cohesion, supports the
general goals of high readability and maintainability.
Cohesion and coupling
Procedural programming
A module here refers to a subroutine of any kind, i.e. a
set of one or more statements having a name and
preferably its own set of variable names.
Content coupling (high)
Content coupling (also known as Pathological
coupling) occurs when one module modifies or relies on
the internal workings of another module (e.g., accessing
local data of another module). In this situation, a change
in the way the second module produces data (location,
type, timing) might also require a change in the
dependent module.
Common coupling
Common coupling (also known as Global coupling)
occurs when two modules share the same global data
(e.g., a global variable). Changing the shared resource
might imply changing all the modules using it.
External coupling
External coupling occurs when two modules share an
externally imposed data format, communication
protocol, or device interface. This is basically related to
the communication to external tools and devices.
Control coupling
Control coupling is one module controlling the flow of
another, by passing it information on what to do (e.g.,
passing a what-to-do flag).
Stamp coupling (Data-structured
coupling)
Stamp coupling occurs when modules share a composite
data structure and use only parts of it, possibly different
parts (e.g., passing a whole record to a function that only
needs one field of it).In this situation, a modification in
a field that a module does not need may lead to
changing the way the module reads the record.
Data coupling
Data coupling occurs when modules share data through,
for example, parameters. Each datum is an elementary
piece, and these are the only data shared (e.g., passing
an integer to a function that computes a square root).
Message coupling (low)
This is the loosest type of coupling. It can be achieved by
state decentralization (as in objects) and component
communication is done via parameters or message
passing.
No coupling
Modules do not communicate at all with one another.
Object-oriented programming
Subclass coupling
Describes the relationship between a child and its
parent. The child is connected to its parent, but the
parent is not connected to the child.
Temporal coupling
 When two actions are bundled together into one
module just because they happen to occur at the same
time.
In recent work various other coupling concepts have
been investigated and used as indicators for different
modularization principles used in practice.
Disadvantages
Tightly coupled systems tend to exhibit the following
developmental characteristics, which are often seen as
disadvantages:
 A change in one module usually forces a ripple effect of
changes in other modules.
 Assembly of modules might require more effort and/or
time due to the increased inter-module dependency.
 A particular module might be harder to reuse and/or
test because dependent modules must be included.
Cohesion
 In computer programming, cohesion refers to the
degree to which the elements of a module belong
together. Thus, cohesion measures the strength of
relationship between pieces of functionality within a
given module. For example, in highlycohesive systems
functionality is strongly related.
 Cohesion is an ordinal type of measurement and is
usually described as “high cohesion” or “low cohesion”.
Cohesion and coupling
Cohesion
Cohesion is a qualitative measure, meaning that the
source code to be measured is examined using
a rubric to determine a classification. Cohesion types,
from the worst to the best, are as follows:
Coincidental cohesion (worst)
Coincidental cohesion is when parts of a module are
grouped arbitrarily; the only relationship between the
parts is that they have been grouped together (e.g. a
“Utilities” class).
Logical cohesion
Logical cohesion is when parts of a module are grouped
because they are logically categorized to do the same
thing even though they are different by nature (e.g.
grouping all mouse and keyboard input handling
routines).
Temporal cohesion
Temporal cohesion is when parts of a module are
grouped by when they are processed - the parts are
processed at a particular time in program execution (e.g.
a function which is called after catching an exception
which closes open files, creates an error log, and notifies
the user).
Procedural cohesion
Procedural cohesion is when parts of a module are
grouped because they always follow a certain sequence
of execution (e.g. a function which checks file
permissions and then opens the file).
Communicational/informational
cohesion
Communicational cohesion is when parts of a module
are grouped because they operate on the same data (e.g.
a module which operates on the same record of
information).
Sequential cohesion
Sequential cohesion is when parts of a module are
grouped because the output from one part is the input to
another part like an assembly line (e.g. a function which
reads data from a file and processes the data).
Functional cohesion (best)
Functional cohesion is when parts of a module are
grouped because they all contribute to a single well-
defined task of the module (e.g. Lexical analysis of an
XML string).
While functional cohesion is considered the most
desirable type of cohesion for a software module, it may
not be achievable. There are cases where
communicational cohesion is the highest level of
cohesion that can be attained under the circumstances.
Cohesion and coupling

More Related Content

PPT
Coupling and cohesion
PPTX
unit testing and debugging
PDF
Software Engineering : OOAD using UML
PPTX
Modules and modularization criteria
PPTX
Software engineering rogers pressman chapter 7
PDF
Object oriented software engineering concepts
PPT
Unified Modeling Language
PPT
Formal Specification in Software Engineering SE9
Coupling and cohesion
unit testing and debugging
Software Engineering : OOAD using UML
Modules and modularization criteria
Software engineering rogers pressman chapter 7
Object oriented software engineering concepts
Unified Modeling Language
Formal Specification in Software Engineering SE9

What's hot (20)

PPTX
Language and Processors for Requirements Specification
PPTX
Staffing level estimation
PPTX
Chapter 1 2 - some size factors
DOCX
Behavioural modelling
PPTX
Phased life cycle model
PPTX
Design Concepts in Software Engineering-1.pptx
PPTX
Software requirements specification
PPTX
Distributed database management system
PPTX
Query processing and optimization (updated)
PPT
Flow oriented modeling
PPT
Rad model
PPTX
Fundamental design concepts
PPT
15. Transactions in DBMS
PPTX
Software Evolution
PPTX
Estimating Software Maintenance Costs
PPTX
Peephole Optimization
PPTX
Design Concept software engineering
PPTX
Software Project Management - Staffing
PPT
Requirement specification (SRS)
PPT
Architecture design in software engineering
Language and Processors for Requirements Specification
Staffing level estimation
Chapter 1 2 - some size factors
Behavioural modelling
Phased life cycle model
Design Concepts in Software Engineering-1.pptx
Software requirements specification
Distributed database management system
Query processing and optimization (updated)
Flow oriented modeling
Rad model
Fundamental design concepts
15. Transactions in DBMS
Software Evolution
Estimating Software Maintenance Costs
Peephole Optimization
Design Concept software engineering
Software Project Management - Staffing
Requirement specification (SRS)
Architecture design in software engineering
Ad

Viewers also liked (20)

PPTX
Cohesion & Coupling
PPTX
Software engineering
PPTX
CHAPTER 2
PDF
CakeFest 2011 - Coupling and cohesion
PPTX
Software Engineering Process Models
PDF
Bitmark and Hyperledger Workshop: the Digital Assets and Property
PDF
OfficeCentral User Manual HRMS (Bahasa Melayu) V3R2
PPT
Files in c++ ppt
PDF
The Inside Scoop on Trulia's Best-in-Class Optimization Strategy
PPTX
Object oriented and function oriented design
PPTX
Cohesion and coherence
PPT
Cohesion and coherence
PPTX
Software Design 1: Coupling & cohesion
PPT
Top down design
ODP
Software Measurement: Lecture 1. Measures and Metrics
PPT
Cohesion general overview
PDF
Autonomy, Connection, and Excellence; The Building Blocks of a DevOps Culture
PPTX
Functional point analysis
PDF
Chapter 6 software metrics
PPT
Coherence And Cohesion
Cohesion & Coupling
Software engineering
CHAPTER 2
CakeFest 2011 - Coupling and cohesion
Software Engineering Process Models
Bitmark and Hyperledger Workshop: the Digital Assets and Property
OfficeCentral User Manual HRMS (Bahasa Melayu) V3R2
Files in c++ ppt
The Inside Scoop on Trulia's Best-in-Class Optimization Strategy
Object oriented and function oriented design
Cohesion and coherence
Cohesion and coherence
Software Design 1: Coupling & cohesion
Top down design
Software Measurement: Lecture 1. Measures and Metrics
Cohesion general overview
Autonomy, Connection, and Excellence; The Building Blocks of a DevOps Culture
Functional point analysis
Chapter 6 software metrics
Coherence And Cohesion
Ad

Similar to Cohesion and coupling (20)

PPTX
software engineering
PPTX
Coupling , Cohesion and there Types
PPTX
Cohesion and coupling in software design
PPTX
4 B-Coupling and Cohesion-1.pptx
PPT
Couplingand cohesion student
PPTX
software engineering
PPT
12 couplingand cohesion-student
PPTX
EFFECTIVE MODULAR DESIGN.pptx
PPTX
SOFTWARE DESIGN_Module_1_Module_2_3.pptx
PPTX
Software Engineering Unit 3 PPT Software Design
PPT
SE-coupling and cohesion.ppt
PPTX
Unit3 Software engineering UPTU
PPTX
Seminar presentation by geethu..Software engineering .pptx
PPTX
Se 381 - lec 22 - 24 - 12 may15 - modularity - i - coupling
PPT
Coupling coheshion tps
PPTX
Designing PrinciplesOf Software
PDF
Cohesion and coupling software desgin engineering
DOCX
PPTX
2.Modular Design.pptx
PPTX
unit3_.pptx ghhu hhiiiiiiiihggguuugggggij
software engineering
Coupling , Cohesion and there Types
Cohesion and coupling in software design
4 B-Coupling and Cohesion-1.pptx
Couplingand cohesion student
software engineering
12 couplingand cohesion-student
EFFECTIVE MODULAR DESIGN.pptx
SOFTWARE DESIGN_Module_1_Module_2_3.pptx
Software Engineering Unit 3 PPT Software Design
SE-coupling and cohesion.ppt
Unit3 Software engineering UPTU
Seminar presentation by geethu..Software engineering .pptx
Se 381 - lec 22 - 24 - 12 may15 - modularity - i - coupling
Coupling coheshion tps
Designing PrinciplesOf Software
Cohesion and coupling software desgin engineering
2.Modular Design.pptx
unit3_.pptx ghhu hhiiiiiiiihggguuugggggij

Recently uploaded (20)

PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Digital Strategies for Manufacturing Companies
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
medical staffing services at VALiNTRY
PPTX
history of c programming in notes for students .pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Online Work Permit System for Fast Permit Processing
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Nekopoi APK 2025 free lastest update
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Digital Strategies for Manufacturing Companies
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
How Creative Agencies Leverage Project Management Software.pdf
medical staffing services at VALiNTRY
history of c programming in notes for students .pptx
CHAPTER 2 - PM Management and IT Context
Online Work Permit System for Fast Permit Processing
ISO 45001 Occupational Health and Safety Management System
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Nekopoi APK 2025 free lastest update
VVF-Customer-Presentation2025-Ver1.9.pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Design an Analysis of Algorithms II-SECS-1021-03
ManageIQ - Sprint 268 Review - Slide Deck
Wondershare Filmora 15 Crack With Activation Key [2025
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
How to Migrate SBCGlobal Email to Yahoo Easily

Cohesion and coupling

  • 3. Coupling (computer programming)  In software engineering, coupling is the degree of interdependence between software modules; a measure of how closely connected two routines or modules are; the strength of the relationships between modules.  Coupling is usually contrasted with cohesion. Low coupling often correlates with high cohesion, and vice versa. Low coupling is often a sign of a well- structured computer system and a good design, and when combined with high cohesion, supports the general goals of high readability and maintainability.
  • 5. Procedural programming A module here refers to a subroutine of any kind, i.e. a set of one or more statements having a name and preferably its own set of variable names.
  • 6. Content coupling (high) Content coupling (also known as Pathological coupling) occurs when one module modifies or relies on the internal workings of another module (e.g., accessing local data of another module). In this situation, a change in the way the second module produces data (location, type, timing) might also require a change in the dependent module.
  • 7. Common coupling Common coupling (also known as Global coupling) occurs when two modules share the same global data (e.g., a global variable). Changing the shared resource might imply changing all the modules using it.
  • 8. External coupling External coupling occurs when two modules share an externally imposed data format, communication protocol, or device interface. This is basically related to the communication to external tools and devices.
  • 9. Control coupling Control coupling is one module controlling the flow of another, by passing it information on what to do (e.g., passing a what-to-do flag).
  • 10. Stamp coupling (Data-structured coupling) Stamp coupling occurs when modules share a composite data structure and use only parts of it, possibly different parts (e.g., passing a whole record to a function that only needs one field of it).In this situation, a modification in a field that a module does not need may lead to changing the way the module reads the record.
  • 11. Data coupling Data coupling occurs when modules share data through, for example, parameters. Each datum is an elementary piece, and these are the only data shared (e.g., passing an integer to a function that computes a square root).
  • 12. Message coupling (low) This is the loosest type of coupling. It can be achieved by state decentralization (as in objects) and component communication is done via parameters or message passing.
  • 13. No coupling Modules do not communicate at all with one another.
  • 15. Subclass coupling Describes the relationship between a child and its parent. The child is connected to its parent, but the parent is not connected to the child.
  • 16. Temporal coupling  When two actions are bundled together into one module just because they happen to occur at the same time.
  • 17. In recent work various other coupling concepts have been investigated and used as indicators for different modularization principles used in practice.
  • 18. Disadvantages Tightly coupled systems tend to exhibit the following developmental characteristics, which are often seen as disadvantages:  A change in one module usually forces a ripple effect of changes in other modules.  Assembly of modules might require more effort and/or time due to the increased inter-module dependency.  A particular module might be harder to reuse and/or test because dependent modules must be included.
  • 19. Cohesion  In computer programming, cohesion refers to the degree to which the elements of a module belong together. Thus, cohesion measures the strength of relationship between pieces of functionality within a given module. For example, in highlycohesive systems functionality is strongly related.  Cohesion is an ordinal type of measurement and is usually described as “high cohesion” or “low cohesion”.
  • 21. Cohesion Cohesion is a qualitative measure, meaning that the source code to be measured is examined using a rubric to determine a classification. Cohesion types, from the worst to the best, are as follows:
  • 22. Coincidental cohesion (worst) Coincidental cohesion is when parts of a module are grouped arbitrarily; the only relationship between the parts is that they have been grouped together (e.g. a “Utilities” class).
  • 23. Logical cohesion Logical cohesion is when parts of a module are grouped because they are logically categorized to do the same thing even though they are different by nature (e.g. grouping all mouse and keyboard input handling routines).
  • 24. Temporal cohesion Temporal cohesion is when parts of a module are grouped by when they are processed - the parts are processed at a particular time in program execution (e.g. a function which is called after catching an exception which closes open files, creates an error log, and notifies the user).
  • 25. Procedural cohesion Procedural cohesion is when parts of a module are grouped because they always follow a certain sequence of execution (e.g. a function which checks file permissions and then opens the file).
  • 26. Communicational/informational cohesion Communicational cohesion is when parts of a module are grouped because they operate on the same data (e.g. a module which operates on the same record of information).
  • 27. Sequential cohesion Sequential cohesion is when parts of a module are grouped because the output from one part is the input to another part like an assembly line (e.g. a function which reads data from a file and processes the data).
  • 28. Functional cohesion (best) Functional cohesion is when parts of a module are grouped because they all contribute to a single well- defined task of the module (e.g. Lexical analysis of an XML string).
  • 29. While functional cohesion is considered the most desirable type of cohesion for a software module, it may not be achievable. There are cases where communicational cohesion is the highest level of cohesion that can be attained under the circumstances.