What is cohesion?

Asked 06-Apr-2022
Viewed 417 times

1 Answer


0

  • The degree to which the pieces within a module belong together is referred to as cohesiveness in computer programming.  It is, in one sense, a measure of the strength of the relationship between a class's methods and data and some overarching goal or concept that the class serves. In another sense, it's a metric for how strong the link between the class's methods and the data is.
  • Cohesion is a form of ordinal measurement that can be classified as 'high cohesion' or 'poor cohesion.' High cohesion is connected with various desirable characteristics of software, including resilience, reliability, reusability, and understandability, hence modules with high cohesion are preferred. Low cohesiveness, on the other hand, is linked to undesirable characteristics such as being difficult to maintain, test, reuse, or even comprehend.
  • Cohesion is frequently contrasted with coupling, which is a completely separate notion. Cohesion is frequently associated with loose coupling, and vice versa.


Read More: What is mean by Data flow diagram?