Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Cohesion (computer science)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Degree to which elements within a module belong together}} In [[computer programming]], '''cohesion''' refers to the ''degree to which the elements inside a [[module (programming)|module]] belong together''.<ref name="Yourdon_1979"/> In one sense, it is a measure of the strength of relationship between the [[Method (computer programming)|methods]] and data of a [[Class (computer programming)|class]] and some unifying purpose or concept served by that class. In another sense, it is a measure of the strength of relationship between the class's methods and data. Cohesion is an [[level of measurement#Ordinal_scale|ordinal]] type of measurement and is usually described as “high cohesion” or “low cohesion”. Modules with high cohesion tend to be preferable, because high cohesion is associated with several desirable software traits including [[Robustness (computer science)|robustness]], reliability, [[reusability]], and understandability. In contrast, low cohesion is associated with undesirable traits such as being difficult to maintain, test, reuse, or understand. Cohesion is often contrasted with [[coupling (computer science)|coupling]]. High cohesion often correlates with [[loose coupling]], and vice versa.<ref name="Ingeno_2018"/> The [[software metric]]s of coupling and cohesion were invented by [[Larry Constantine]] in the late 1960s as part of [[Structured Design]], based on characteristics of “good” programming practices that reduced maintenance and modification costs. Structured Design, cohesion and coupling were published in the article ''Stevens, Myers & Constantine'' (1974)<ref name="Stevens_1974"/> and the book ''Yourdon & Constantine'' (1979).<ref name="Yourdon_1979"/> The latter two subsequently became standard terms in [[software engineering]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)