Coupling (computer programming)

Uses your system voice; voice and rate in settings.

Snapshot

≈ 3 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

In software engineering, coupling is the degree of interdependence between software modules, a measure of how closely connected two routines or modules are, and the strength of the relationships between modules. Coupling is not binary but multi-dimensional. Coupling is usually contrasted with cohesion. Low coupling often correlates with high cohesion, and vice versa. Low coupling is often thought to be a sign of a well-structured computer system and a good design, and when combined with high cohesion, supports the general goals of high readability and maintainability.

In software engineering, coupling is the degree of interdependence between software modules, a measure of how closely connected two routines or modules are, and the strength of the relationships between modules. Coupling is not binary but multi-dimensional. ]] Coupling is usually contrasted with cohesion. Low coupling often correlates with high cohesion, and vice versa. Low coupling is often thought to be a sign of a well-structured computer system and a good design, and when combined with high cohesion, supports the general goals of high readability and maintainability. ==History== The software quality metrics of coupling and cohesion were invented by Larry Constantine in the late 1960s as part of a structured design, based on characteristics of “good” programming practices that reduced maintenance and modification costs. Structured design, including cohesion and coupling, were published in the article Stevens, Myers & Constantine (19741) and the book Yourdon & Constantine (1979), and the latter subsequently became standard terms. \mathrm{Coupling}(C) = 1 - \frac{1}{d_{i} + 2\times c_{i} + d_{o} + 2\times c_{o} + g_{d} + 2\times g_{c} + w + r} Coupling(C) makes the value larger the more coupled the module is. This number ranges from approximately 0.67 (low coupling) to 1.0 (highly coupled) For example, if a module has only a single input and output data parameter C = 1 - \frac{1}{1+0+1+0+0+0+1+0} = 1 - \frac{1}{3} = 0.67 If a module has 5 input and output data parameters, an equal number of control parameters, and accesses 10 items of global data, with a fan-in of 3 and a fan-out of 4, C = 1 - \frac{1}{5 + 2\times 5 + 5 + 2\times 5 + 10 + 0 + 3 + 4} = 0.98 ==See also== Connascence (computer science) Coupling (physics) Dead code elimination Dependency hell Efferent coupling Inversion of control List of object-oriented programming terms Loose coupling Make (software) Static code analysis

Text derived from https://en.wikipedia.org/w/index.php?oldid=1367462368 under CC BY-SA 4.0; modifications have been made.

References

  1. ↩Wikipedia publication date (×1) · confidence 0.95 https://en.wikipedia.org/w/index.php?oldid=1367462368