Introduction to Coupling in Software Engineering
Coupling in Software Engineering is a part of Software Requirement Specification (SRS) documentation that is used to define the factors of dependency and independence of each module of the software with other modules. It is used as an indicator of interdependency amongst the modules, and the lower the coupling value will be, the higher the quality of the software will be. The name coupling is applied for this process, as it is typically deliberated between two modules at a time. The first step taken in the coupling process is to evaluate the association between the two modules and to define the functionally dependent areas in the modules.
Types of Coupling
Coupling between any two modules is identified from the number and types of resources that the modules share with other modules. This resource can be a functional behavior, a common interface, a common field in a user interface, the data picked from a field and shared between two modules, a transaction shared between two modules, etc. Based on these possible dependencies, the coupling in software engineering is classified into six different types of coupling. And, they are
- Common Coupling
- Content Coupling
- Data Coupling
- Control Coupling
- Stamp Coupling
Every software requirement specification documentation process should have a classification of these coupling between the dependent modules, whichever is applicable after a brief evaluation performed on the requirement provided by the client.
1. Common Coupling
Common Coupling consists of the modules that share the overall constraints in the midst of any two modules of the software system. This also can be a sign of any change made in the common constraint will reflect in the modules that share the common coupling scenario. As any other process, this common coupling also allows space for characterizing the advantages and disadvantages involved in the process. This type of dependency should be evaded as it calls for more maintenance activities and lesser control over the modules. A fine example of this kind of coupling is the login page, where the login module and the backend module are interdependent, as the login validation happens both in the login page level and the backend database level.
2. Content Coupling
Content coupling, as the name says, is a case where two modules share their contents and when a change is made in one module the other module needs to be updated as well. When the modules are not in synch, it leads to higher level of functional misbehavior. For Instance, when two modules share the same data, the primary key columns for both the modules’ databases should be related, or else the content of the modules will reflect non-synch data due to the dependency.
3. Data Coupling
When two modules of the software system has only one type of interaction between them, and of that interaction is in the form of data, then this type of coupling is termed as Data Coupling. Other than the form of data, the modules have no other commonly shared resources like the functionality or any other system components. An example of data coupling is that two user interfaces, which share data in terms like module 1 passes data for processing to module 2 and received the processed data back from module 2. Though all the coupling needs to be minimized, this type of coupling is tolerable as it does not affect any other functional behavior of the software.
4. Control Coupling
Control coupling is a functional flow of the software where the two software modules network by provisioning the shared control involving the modules’ functional activities. The impact of this type of coupling on the software application can either be a positive one or a negative one, as it can be defined only based on the type of control being shared by the said modules. It is seen as a positive impact, when the functionality is allowed for reusability. This type of coupling is usually observed in code level, when the arguments are reused in more than one place in the functional part of the code.
5. Stamp Coupling
Stamp coupling is detected between any two modules which share a compilation of an already structured intricate set of data. As the data and elements are pre-organized and well-placed beforehand, there will be no junk or unused data shared between the two coupling modules. This helps in improving the general efficiency of the software and its performance, while the system designer should know the limitations to what extent the stamp coupling can be allowed in the system.
6. External Coupling
External coupling can be described as a situation where the modules are interrelated with common external influencing factors. It can be ‘an external legacy application which sends the same set of data or contents to both modules’, or ‘a hardware requirement common for both modules’, or ‘a common file/ folder being used by both modules’, or ‘when both use same switch/ router in the network for communication’, etc.
Advantages of Coupling in Software Engineering
In the Software Engineering process, as a part of Software Development Lifecycle, the Design phase has ‘coupling’ as one of the essential steps to be completed.
Below are the key advantages of performing the coupling process,
- It helps in identifying the dependencies of each module with other modules in the
- It is mainly used for increasing the quality and performance of the software application, as the analysis aids in keeping the coupling value to the
- Coupling supports the reusability of the functionality amongst the
- When the dependency between the modules is less, the changes done in one unit will not affect the
- It provides room for better methods for the maintenance of the
Coupling in Software Engineering is a crucial process, as it is significant in recognizing and limiting the connection amid the various modules of the software. In addition to this, coupling plays a major role in holding the quality and performance of the software system to a maximum level, by keeping in check the link amidst of all the elements in the software.
This is a guide to Coupling in Software Engineering. Here we discuss the 6 different types of Coupling in Software Engineering along with the respective advantages. You may also have a look at the following articles to learn more –