Introduction
Coupling and cohesion are fundamental concepts in software engineering, assessing the effectiveness of a software system's design. Cohesion and coupling is very essential to build maintainable, scalable, and resilient software applications.

In this article we are going to discuss the two essential terminologies of software designing, i.e. Coupling and cohesion, their type, differences, and characteristics of good software
What is Coupling?
Coupling is the degree to which two modules are interrelated. It measures the degree of interdependence between the modules. Coupling indicates the strength of dependencies between the modules. E.g. In a loosely coupled system, modules are less dependent on each other and can concentrate better on their allotted task than in a tightly coupled system where modules are highly reliant on each other.

Types of Coupling
- No direct Coupling
As the name suggests, no direct connection formed between the modules in this type of Coupling. No Direct Coupling is the most desired Coupling as modules are unrelated and can focus on their assigned task.
- Data Coupling
In this type of Coupling, one or more data is shared between the modules. The data could be of int or float type. Sharing of data between modules results in interdependency and thus difficulty focussing on their own assigned task.
- Content Coupling
Defined as the worst form of Coupling as control flow or program code is shared between the modules involved results in control of one function by another. One module depends on another module implementation. This type of Coupling needs to be avoided from our software system at any cost.
- Control Coupling
If involved modules communicate by passing control information to each other, then such a coupling is called control coupling. One function directs the flow of another process, i.e. data from one function controls the execution of another function.
- External Coupling
This type of Coupling is formed if the involved module shares an external data format. In this type of Coupling, the related modules share a structure, an interface or a communication protocol.
- Common Coupling
This type of Coupling involves modules that share common data with the help of global data items. Any change in the global data traces back changes to every module which accesses the data.
- Stamp Coupling
Also known as Data Structure coupling, a module shares a complete data structure with another module that uses only some part of the data that is too different.
What is Cohesion?
Cohesion tells us the degree to which elements of a particular module are functionally related to each other. It measures the degree to which different elements of the module are directed to perform the same task and are contained in a single component.

It helps us measure the strength of a module, i.e. how well the aspects of modules are interrelated to each other. e.g. a system with high cohesion has elements that are highly related to each other, which helps in performing the assigned task much better than a system with low cohesion where the module elements are less related.
Also see, V Model in Software Engineering
Types of Cohesion
- Functional Cohesion
This type of cohesion exists if elements inside the modules have a single goal. The elements of the modules work in coordination to stay focused on the task assigned. They only perform the activities which are essential for the completion of the task assigned.
- Sequential Cohesion
Sequential cohesion maintains the sequence of activity. The outcome data of one feature works as an input to others. It helps to deliver good Coupling and makes maintenance easy due to a well-defined sequence of events.
- Logical Cohesion
In logical cohesion, elements are related logically, not functionally. Logical cohesion exists if all the functions within a module execute a similar operation. Such modules are said to be logically cohesive.
- Communicational Cohesion
Two aspects of the modules working on the same input data and contributing to the same output have communicational cohesion. Two elements of modules are grouped as they operate on the same data.
- Temporal Cohesion
In this type of cohesion where a module includes functions that are associated by the fact of execution at the same time simultaneously. The module associated with this cohesion has to execute all the tasks simultaneously at the same time.
- Procedural Cohesion
In this type of cohesion, the purpose of the involved module is all parts of a procedure in which to achieve a particular goal, a sequence of steps has to be carried out.
- Coincidental Cohesion
Elements of the modules are unrelated. This is the worst type of cohesion possible as only a few elements of the modules are related, if related at all.
Difference Between Coupling and Cohesion
Coupling and cohesion are two crucial terms in Software Engineering. Both measure the degree of dependencies just on different parts of the system. So it is vital to understand the essential difference between the two.
| Coupling | Cohesion |
|
|
|
|
|
|




