Lecture 16: Cohesion and Coupling, Users and Usability Flashcards
What are the ways to measure independence?
Cohesion and coupling
What is cohesion?
A measure of the relative functional strength of a model
Higher cohesive systems have increased readability and reusability
Cohesive if methods are similar in many aspects
What are the types of cohesion?
Functional (best)
Communicational/Informational (almost as good)
Procedural
Temporal
Logical
Coincidental (worst)
What is coincidental cohesion?
Difficult to describe the module’s functions or activities
Module performs series of unrelated activities
What is logical cohesion?
Modules which perform logically related activities are directed by the calling program or an internal control variable
What is temporal cohesion?
Modules which perform activities related by time, must be done together
Functions are weakly related to each other
What is procedural cohesion?
Performs more than one function, which are problem related and carried out in a time related sequential order
What is communicational/informational cohesion?
Performs more than one function on the same data
Related sequentially (time) and procedurally
What is functional (best) cohesion?
Modules that perform exactly one function, a single well-defined task
What is coupling?
A measure of the relative interdependence among modules
Changes in one place may require changes somewhere else
What are the types of coupling?
Data (best)
Stamp
Control
External
Common
Content (worst)
What is content coupling?
Two modules are content coupled if one directly references the contents of the other
What is common coupling?
Two components have and use write access privileges to the same global data
What is external coupling?
Modules use or pass data and/or control signals to external systems or devices
What is control coupling?
Two components are control coupled if one passes an element of control to the other component