Coupling in Software Engineering

This article is an introduction to a very popular term related to software development: Coupling. In this article, we are going to learn what this term means and how is it connected to software development?
By Monika Sharma Last updated : April 05, 2023

Coupling

In general terms, the term coupling is defined as a thing that joins together two objects. If we talk about software development, then the term coupling is related to the connection between two modules, i.e. how tight interaction do the two modules hold with each other is defined by coupling.

Hence, the term coupling is defined as follows: "The measure of the degree of the interdependency of two modules on each other is known as coupling."

It should be noted that a module that has high cohesion and low coupling is functionally independent.

How can the coupling between two modules be defined?

The interconnection of interdependency between two modules is defined by the interface between them because any two modules cannot be connected if there exists no interface between them. Now, the level of coupling that exists among the two modules is defined by the number of data transfers that take place among them. If any of the modules (or both) is highly dependent on the data that the other module provides to it, then we say that the two modules are highly coupled. Else, we say that the two modules are loosely coupled or the coupling between the modules is low.

Now, the term coupling is further classified into different classes which help us to quantitatively determine the level of coupling between two modules. The different classes of coupling are as follows:

coupling in software engineering

Classification of Coupling

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:

1) Content Coupling

In the content coupling, the two modules are connected as they share the same content. What this means is that the content, i.e. the code of both the modules, has some parts in common which are the functions and methods that are used by both of the modules. This type of coupling is termed to be the strongest type of coupling.

2) Common Coupling

Two modules are said to be commonly coupled if they share the data using the same data items (i.e. the variables). These data items must be in global access to both of the modules so that both the modules can be able to access these data items.

3) Control Coupling

If the data from the module is responsible for controlling the activities happening in another module, then these modules are said to be control coupled. Here, mostly, one or two bits of signal data are passed which controls the operations happening in some other module. A well-known example of this can be the set of flags of a module by some other module.

4) Stamp Coupling

Two modules are said to be stamp coupled if they both use a composite data item to interact with each other.

5) Data Coupling

This type of coupling is the weakest one. Two modules are said to be data coupled if they communicate through some parameters. An example can be of the parameters that are passed to a function block.





Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.