Cohesion in Software Engineering

In this tutorial, we will learn about the cohesion in software engineering and its classifications. By Monika Sharma Last updated : April 05, 2023


In general terms, the word cohesion means 'the action or act of forming a united whole'. According to the definition of Cambridge University, cohesion is defined as "the state of sticking together, or being in close agreement and working well together".

Now, if we talk about software, the developers and researchers nowadays are trying to develop software in a component-based approach. In this, the entire software is divided into different modules. These modules are developed independently and are capable of performing some specific functionality. Now, for the software to be efficient, these modules must have high cohesion. What this means is that the same types of functionalities and behavior must be performed by a single module. Now, as the same type of functionalities is performed in a united way together in a single module, the quality of the software will automatically increase, and also the component-based structure of the software would make it easier for the developers to understand it better and handle it efficiently in case of error and bugs.

Now, the cohesion of a module is further classified into different classes. This classification is done based on the level of cohesion that a particular module possesses. The different classes of cohesion are as follows:

cohesion in software engineering

The sequence of the given classification is from high to low in a top-to-down manner. Now, let us define each of them to understand what they mean:

Classification of Cohesion

The classification of cohesion are:

1) Functional Cohesion

If a single module aims to perform all the similar types of functionalities through its different elements, then the module is said to exhibit functional cohesion.

2) Sequential Cohesion

In the sequential cohesion, the different elements of a module form a series, in which the output of one element treats as an input to the other elements inside the same module. Hence, a sequence inside the module is formed.

3) Communicational Cohesion

If all the elements of a module are working on the same data and are accessing that data through the same data structures, then this is called communicational cohesion.

4) Procedural Cohesion

If all the elements of a module are a part of the same procedure, i.e. algorithm, then that particular module is said to possess procedural cohesion.

5) Temporal Cohesion

In the temporal cohesion, the different elements of a module are united through the time stamp. All these elements of the module will work in the same timestamp, and here, the time is handled strictly. The login and shutdown processes are very good examples of temporal cohesion.

6) Logical Cohesion

A module is said to exhibit logical cohesion if all its elements perform the same type of logical operations. For example, if a module is performing the sorting operation, then all the processes that need to perform sorting in them will be handled by this module only.

Comments and Discussions!

Load comments ↻

Copyright © 2024 All rights reserved.