A measure of the strength of the connection between two functions is

cohesion
coupling
dependence
subjection

The correct answer is B. Coupling.

Coupling is a measure of the strength of the connection between two functions. A high degree of coupling indicates that the two functions are tightly linked together and that changes to one function are likely to have a significant impact on the other function. A low degree of coupling indicates that the two functions are loosely linked together and that changes to one function are unlikely to have a significant impact on the other function.

Coupling can be measured in terms of the number of parameters that are passed between the two functions, the number of global variables that are accessed by the two functions, and the number of subroutines that are called by the two functions.

High coupling can make it difficult to test and maintain software. When two functions are tightly coupled, it can be difficult to test one function without also testing the other function. This can make it difficult to identify and fix bugs. Additionally, high coupling can make it difficult to modify software. When two functions are tightly coupled, changes to one function can have unexpected consequences for the other function. This can make it difficult to keep software up-to-date with changes in requirements.

Low coupling can make it easier to test and maintain software. When two functions are loosely coupled, it is easier to test one function without also testing the other function. This can make it easier to identify and fix bugs. Additionally, low coupling can make it easier to modify software. When two functions are loosely coupled, changes to one function are less likely to have unexpected consequences for the other function. This can make it easier to keep software up-to-date with changes in requirements.

There are a number of techniques that can be used to reduce coupling, such as:

  • Using well-defined interfaces
  • Passing data through parameters instead of global variables
  • Using subroutines instead of calling functions directly
  • Using encapsulation
  • Using abstraction

Reducing coupling can make software more maintainable and extensible.

Exit mobile version