Ask a Question

what is the difference between coupling and cohesion in the field of software engg.

on 2011-05-12 14:53:37   by Aparna   on Computer Science & Engineering  1 answers

rituparna

on 2011-05-12 09:30:00  

Coupling and cohesion are often used as opposite ends of a scale in measuring how \"good\" a piece of software is. They are very common metrics for measuring the quality of object-oriented code. Cohesion describes how \"focused\" a piece of software is. A highly-cohesive system is one in which all procedures in a given module work together towards some end goal. High cohesion is often characterized by high readability and maintainability. Coupling describes how reliant a given piece of software is on other modules. A highly coupled system in one in which the procedures in one module can directly access elements of another module. A low coupled system in one in which the procedures of one module can only interact with the procedures of another through an interface channel. Highly coupled systems are often characterized by code that is difficult to read and maintain (the reason cohesion and coupling are often used as opposites).