Types of Cohesion in Software Engineering

Cohesion:

Cohesion of a module is the degree to which the different functions of the module cooperate to work towards a single objective. It is a measure that defines the degree of intra-dependability within an element of a module.

Types of Cohesion:

There are seven types of Cohesion as given as follows:
1. Coincidental Cohesion: It is unplanned and random cohesion which might be the result of breaking the program into smaller modules for the sake of modularization.

2. Logical Cohesion: When logically categorized elements are put together into a module. It is called Logical Cohesion.

3. Temporal Cohesion: When elements of the module are organized such that they are processed at a similar point in time, it is called Temporal Cohesion.

4. Procedural Cohesion: When elements of the module are grouped which are executed sequentially to perform a task. It is called Procedural Cohesion.

5. Communicational Cohesion: When elements of the module are grouped which are executed sequentially and work on the same data. It is called Communicational Cohesion.

6. Sequential Cohesion: When elements of the module are grouped because the output of one element serves as input to another. It is called Sequential Cohesion.

7. Functional Cohesion: It is considered to be the highest degree of cohesion and it is highly expected. Elements of the module in functional cohesion are grouped because they all contribute to a single well-defined function. It can also be reused.