Cohesion – Types of cohesion


Cohesion is the measure of functional relatedness of elements within a single module. When dividing a system into modules, it must ensure that the activities within the module are tightly bound to one another.
There are seven types of cohesion:
1. Functional cohesion
2. Sequential cohesion
3. Communicational cohesion
4. Procedural cohesion
5. Temporal cohesion
6. Logical cohesion
7. Coincidental cohesion

Types of cohesion

Functional cohesion:

  1. All activities in the module are functionally related or they are performing a similar function.
  2. The chances of a change request affecting more than one module are low if the modules are based on functionality. Hence, this is the best form of cohesion.

Sequential cohesion:

  1. In this scheme of cohesion, modules are divided into a series of activities such that the output of one module becomes the input to the next module and the chain continues.

Communicational cohesion:

  1. This form of cohesion relates to a situation where all modules share some common data.
  2. This form of cohesion has clearly defined boundaries, inputs, and outputs.

Procedural cohesion:

  1. In this type of cohesion, activities share the same procedural implementation.

Temporal cohesion:

  1. In this type of module division, activities occurring in the same period are grouping together.
  2. The set of functions responsible for initialization, start-up activities such as setting program counters or control flags associated with programs exhibit temporal cohesion.

Logical cohesion:

  1. In logical cohesion, activities belonging to the same category are grouped together.
  2. We can group all reporting activities together or all querying activities together.

Coincidental cohesion:

  1. The Coincidental cohesion exists in modules that contain instructions that have little or no relationship to one another.
  2. Coincidental cohesion is can be avoid as far as possible.

Read more about Coupling