Modularity
Modularity Achieved by dividing the software into uniquely
named and addressable components, which are also known as
modules. Two Main properties of Modules-
(a) Coupling- communication between different modules
(b) Cohesiveness-grouping of all functionally related elements
Module Coupling
Coupling is the measure of the degree of interdependence between
modules
Types of Module Coupling
1. Data Coupling BEST
2. Stamp Coupling
3. Control Coupling
4. External Coupling
5. Common Coupling
6. Content Coupling WORST
Data Coupling
The dependency between module A and B is said to be data
coupled if their dependency is based on the fact they
communicate by only passing of data. Other than
communicating through data, the two modules are
independent
Stamp coupling
Stamp coupling occurs between module A and B when
complete data structure is passed from one module to another.
If they communicate using a composite data item .
Control coupling
Module A and B are said to be control coupled if they communicate by passing of
control information. This is usually accomplished by means of flags that are set by
one module and reacted upon by the dependent module. If data from one module
is used to direct the order of instruction execution in other.
Common coupling
If they share some global data items. Global data areas are commonly found in
programming languages. Making a change to the common data means tracing
back to all the modules which access that data to evaluate the effect of changes.
Content coupling
Content coupling exists between two modules, if they share code. That is jump
from one module into the code of another module can occur.
Example of content coupling
Coupling should be low for better software design. High coupling among
modules not only makes a design solution difficult to understand and maintain,
but it also increases development effort and also makes it very difficult to get
these modules developed independently by different team members.
Module Cohesion
Cohesion=Strength of relations within modules
When the functions of module cooperate with each other
for performing a single objective, then the module has
good cohesion.
Module Strength
Types of cohesion
• Functional cohesion BEST(High)
• Sequential cohesion
• Procedural cohesion
• Temporal cohesion
• Logical cohesion
• Coincident cohesion WORST(Low)
Functional Cohesion
If different functions of the module cooperate to complete a single a single task. A
and B are part of a single functional task. This is very good reason for them to be
contained in the same procedure.
Sequential Cohesion
If the different functions of the module execute in a sequence, and the output from
one function is input to the next in the sequence. Module A outputs some data
which forms the input to B. This is the reason for them to be contained in the same
procedure.
Procedural Cohesion
Procedural Cohesion occurs in modules whose instructions although accomplish
different tasks yet have been combined because there is a specific order in which the
tasks are to be completed.
Temporal Cohesion
Module exhibits temporal cohesion when it contains tasks that are related by the fact
that all tasks must be executed in the same time-span.
Logical Cohesion
If all elements of the module perform similar operations such as error handling data
input, data output etc. Logical cohesion occurs in modules that contain instructions
that appear to be related because they fall into the same logical class of functions
Coincidental Cohesion
Coincidental cohesion exists in modules that contain instructions that have little or
no relationship to one another. We can say that the module contains a random
collection of functions.
Relationship between Cohesion & Coupling
If the software is not properly modularized, a host of seemingly trivial
enhancement or changes will result into death of the project. Therefore, a
software engineer must design the modules with goal of high cohesion and low
coupling.

software engineering

  • 1.
    Modularity Modularity Achieved bydividing the software into uniquely named and addressable components, which are also known as modules. Two Main properties of Modules- (a) Coupling- communication between different modules (b) Cohesiveness-grouping of all functionally related elements Module Coupling Coupling is the measure of the degree of interdependence between modules
  • 2.
    Types of ModuleCoupling 1. Data Coupling BEST 2. Stamp Coupling 3. Control Coupling 4. External Coupling 5. Common Coupling 6. Content Coupling WORST
  • 3.
    Data Coupling The dependencybetween module A and B is said to be data coupled if their dependency is based on the fact they communicate by only passing of data. Other than communicating through data, the two modules are independent Stamp coupling Stamp coupling occurs between module A and B when complete data structure is passed from one module to another. If they communicate using a composite data item .
  • 4.
    Control coupling Module Aand B are said to be control coupled if they communicate by passing of control information. This is usually accomplished by means of flags that are set by one module and reacted upon by the dependent module. If data from one module is used to direct the order of instruction execution in other. Common coupling If they share some global data items. Global data areas are commonly found in programming languages. Making a change to the common data means tracing back to all the modules which access that data to evaluate the effect of changes. Content coupling Content coupling exists between two modules, if they share code. That is jump from one module into the code of another module can occur.
  • 5.
    Example of contentcoupling Coupling should be low for better software design. High coupling among modules not only makes a design solution difficult to understand and maintain, but it also increases development effort and also makes it very difficult to get these modules developed independently by different team members.
  • 6.
    Module Cohesion Cohesion=Strength ofrelations within modules When the functions of module cooperate with each other for performing a single objective, then the module has good cohesion. Module Strength
  • 7.
    Types of cohesion •Functional cohesion BEST(High) • Sequential cohesion • Procedural cohesion • Temporal cohesion • Logical cohesion • Coincident cohesion WORST(Low)
  • 8.
    Functional Cohesion If differentfunctions of the module cooperate to complete a single a single task. A and B are part of a single functional task. This is very good reason for them to be contained in the same procedure. Sequential Cohesion If the different functions of the module execute in a sequence, and the output from one function is input to the next in the sequence. Module A outputs some data which forms the input to B. This is the reason for them to be contained in the same procedure. Procedural Cohesion Procedural Cohesion occurs in modules whose instructions although accomplish different tasks yet have been combined because there is a specific order in which the tasks are to be completed.
  • 9.
    Temporal Cohesion Module exhibitstemporal cohesion when it contains tasks that are related by the fact that all tasks must be executed in the same time-span. Logical Cohesion If all elements of the module perform similar operations such as error handling data input, data output etc. Logical cohesion occurs in modules that contain instructions that appear to be related because they fall into the same logical class of functions Coincidental Cohesion Coincidental cohesion exists in modules that contain instructions that have little or no relationship to one another. We can say that the module contains a random collection of functions.
  • 10.
    Relationship between Cohesion& Coupling If the software is not properly modularized, a host of seemingly trivial enhancement or changes will result into death of the project. Therefore, a software engineer must design the modules with goal of high cohesion and low coupling.