Title: Coupling and Cohesion (by CodeCop)
Tags: Coupling_and_Cohesion Coupling_and_Cohesion_Types_of_Coupling Coupling_and_Cohesion_Coupling_Contributing_Factors Coupling_and_Cohesion_Types_of_Cohesion Coupling_and_Cohesion_Examples_of_Cohesion Coupling_and_Cohesion_Strength_of_Coupling Coupling_and_Cohesion_Examples_of_Coupling Coupling_and_Cohesion_Definition_of_Cohesion Coupling_and_Cohesion_Strength_of_Cohesion Coupling_and_Cohesion_Problems_of_low_Cohesion Coupling_and_Cohesion_Definition_of_Coupling Coupling_and_Cohesion_Postel's_Law

Q: Coupling is the measure of the [...] of association by a connection from one module to another.
A: strength

Q: Coupling is the [...] of interaction between modules.
A: degree

Q: Coupling is the measure of the strength of [...] from one module to another.
A: association by a connection

Q: Coupling is the degree of [...] between modules.
A: interaction

Q: Data Coupling is depending on?
A: simple, local data

Q: Stamp Coupling is depending on?
A: structured, local data

Q: Control Coupling is depending on?
A: element of control (flag)

Q: External Coupling is depending on?
A: simple, global data

Q: Common Coupling is depending on?
A: structured, global data

Q: Content Coupling is depending on?
A: internals

Q: Depending on simple, local data is
A: Data Coupling

Q: Depending on structured, local data is
A: Stamp Coupling

Q: Depending on "element of control" (flag) is
A: Control Coupling

Q: Depending on simple, global data is
A: External Coupling

Q: Depending on structured, global data is
A: Common Coupling

Q: Depending on internals is
A: Content Coupling

Q: Data Coupling is when
A: all data being passed as parameters is used, no extra information is passed into a module

Q: Stamp Coupling is when
A: module 1 passes more than the required data values into module 2

Q: Control Coupling is when
A: module 1 can directly affect the execution of module 2

Q: Common Coupling is when
A: two or more modules have read and write access to the same global data

Q: Content Coupling is when
A: module 1 directly refers to the content of module 2

Q: Temporal Coupling (Sequencing) is when
A: module 1 needs to call methods of module 2 in a certain order

Q: Temporal Coupling (Waiting) is when
A: module 1 has to wait for module 2 to finish

Q: When all data being passed as parameters is used, no extra information is passed into a module, then there is
A: Data Coupling

Q: When module 1 passes more than the required data values into module 2, then there is
A: Stamp Coupling

Q: When module 1 can directly affect the execution of module 2, then there is
A: Control Coupling

Q: When two or more modules have read and write access to the same global data, then there is
A: Common Coupling

Q: When module 1 directly refers to the content of module 2, then there is
A: Content Coupling

Q: When module 1 needs to call methods of module 2 in a certain order, then there is
A: Temporal Coupling (Sequencing)

Q: When module 1 has to wait for module 2 to finish, then there is
A: Temporal Coupling (Waiting)

Q: Types of coupling (ascending by strength)
A: Data, Stamp, Control, External, Common, Content

Q: We aim for [...] coupling.
A: low

Q: Why is low coupling desirable?
A: Changes in one module require fewer changes in other modules.

Q: What problems causes high coupling?
A: Changes in a single module will affect the other module (in a negative manner).

Q: Low form of coupling?
A: Data Coupling

Q: Middle form of coupling?
A: Control Coupling

Q: High form of coupling?
A: Content Coupling

Q: Strength of Data Coupling?
A: Low

Q: Strength of Control Coupling?
A: Middle

Q: Strength of Content Coupling?
A: High

Q: For example passing an entire employee record when only name and email is needed is
A: Stamp Coupling

Q: For example passing an "element of control" such as a switch/flag/signal from one module to another is
A: Control Coupling

Q: For example returning a code which implies some action to be taken is
A: Control Coupling

Q: For example all modules having access to a common database in both read and write mode (even if write mode is not required in all cases) is
A: Common Coupling

Q: For example some module referring to local/private data of another module is
A: Content Coupling

Q: For example some module branching to a local label contained in another module is
A: Content Coupling

Q: For example an "init" method is
A: Temporal coupling

Q: Postel's Law says?
A: Be conservative in what you do, be liberal in what you accept from others.

Q: The Governing law for decoupled collaboration?
A: Postel's Law

Q: Postel's Law: Be [...] in what you do, be liberal in what you accept from others.
A: conservative

Q: Postel's Law: Be conservative in what you do, be [...] in what you accept from others.
A: liberal

Q: When interface complexity is simple/obvious then coupling is?
A: low

Q: When interface complexity is complicated/obscure then coupling is?
A: high

Q: When type of communication is data then coupling is?
A: low

Q: When type of communication is control then coupling is?
A: medium

Q: When type of communication is hybrid then coupling is?
A: high

Q: When type of connection is to module by name then coupling is?
A: low

Q: When type of connection is to internal elements then coupling is?
A: high

Q: When connection and number syntactic units (e.g. parameters) is few then coupling is?
A: low

Q: When connection and number syntactic units (e.g. parameters) is many then coupling is?
A: high

Q: When dependency on state is minimum then coupling is?
A: minimal

Q: For low coupling, interface complexity must be?
A: simple/obvious

Q: For high coupling, interface complexity must be?
A: complicated/obscure

Q: For low coupling, type of communication must be?
A: data

Q: For medium coupling, type of communication must be?
A: control

Q: For high coupling, type of communication must be?
A: hybrid

Q: For low coupling, type of connection must be?
A: to module by name

Q: For high coupling, type of connection must be?
A: to internal elements

Q: For low coupling, connection and number syntactic units (e.g. parameters) must be?
A: few

Q: For high coupling, connection and number syntactic units (e.g. parameters) must be?
A: many

Q: For minimal coupling, dependency on state must be?
A: minimum

Q: Cohesion is a measure of the [...] of a module amongst the pieces of that module.
A: coherence

Q: Cohesion is the [...] to which the elements inside a module belong together.
A: degree

Q: Cohesion is the [...] of methods in a module or class.
A: similarity

Q: Cohesion is a measure of the coherence of a module amongst [...].
A: the pieces of that module

Q: Cohesion is the degree to which the elements inside a module [...].
A: belong together

Q: Cohesion is the similarity of methods [...].
A: in a module or class

Q: In Coincidental Cohesion, which relationship is among the elements of a module?
A: no meaningful relationship

Q: In Logical Cohesion, which relationship is among the elements of a module?
A: logical relationship

Q: In Temporal Cohesion, which relationship is among the elements of a module?
A: executed in the same time period

Q: In Procedural Cohesion, which relationship is among the elements of a module?
A: relation to a sequence of steps performed in the program

Q: In Communicational Cohesion, which relationship is among the elements of a module?
A: reference to the same set of input and/or output data

Q: In Sequential Cohesion, which relationship is among the elements of a module?
A: output data from one element is input for next element

Q: In Functional Cohesion, which relationship is among the elements of a module?
A: performance of a single function

Q: In Informational Cohesion, which relationship is among the elements of a module?
A: each function performs exactly one action

Q: Relationship of no meaningful relationship is?
A: Coincidental Cohesion

Q: Relationship of logical relationship is?
A: Logical Cohesion

Q: Relationship of executed in the same time period is?
A: Temporal Cohesion

Q: Relationship of relation to a sequence of steps performed in the program is?
A: Procedural Cohesion

Q: Relationship of reference to the same set of input and/or output data is?
A: Communicational Cohesion

Q: Relationship of output data from one element is input for next element is?
A: Sequential Cohesion

Q: Relationship of performance of a single function is?
A: Functional Cohesion

Q: Relationship of each function performs exactly one action is?
A: Informational Cohesion

Q: Communicational Binding has the stronger "bond" of?
A: referring to the same data

Q: Types of cohesion (ascending by strength)
A: Coincidental, Logical, Temporal, Procedural, Communicational, Sequential, Functional, Informational

Q: Coincidental Cohesion is the [...] type of binding
A: weakest

Q: Functional Cohesion is the [...] type of binding
A: strongest

Q: We aim for [...] cohesion.
A: high

Q: Why is high cohesion desirable?
A: robustness, reliability, reusability, and comprehensibility

Q: What effect has high cohesion regarding changes?
A: Logical changes in one domain only affect one (or a few) modules.

Q: For example a "template" implementation of quite different operations that share some basic course of action is
A: Logical Cohesion

Q: For example a module that performs all input and output operations for the program is
A: Logical Cohesion

Q: For example a module that edits all data is
A: Logical Cohesion

Q: For example five modules named "initialize", "input", "calculate", "output" and "cleanup" is
A: Temporal Cohesion

Q: For example sequence of operations "read input from the keyboard, validate it, store the answers in global variables" is
A: Procedural Cohesion

Q: For example a module performing several actions, each with a unique entry point, independent code for each action, and all operations are performed on the same data is
A: Informational Cohesion

Q: A module with functional description as compound sentence, containing a comma, or more than one verb
A: (is performing more than one function and probably) has Sequential or Communicational Cohesion.

Q: A module with functional description containing words relating to time, such as "first", "next", "then", "after", "when", "start", etc.
A: has Temporal or Sequential Cohesion.

Q: A module with functional description containing words such as "initialize", "clean up", etc.
A: has Temporal Cohesion.

Q: A module with functional description not containing a single specific object following the verb
A: has (probably) Logical Cohesion.

Q: Which cohesion is worse than no modularization at all?
A: Coincidental Cohesion

Q: Which problems are caused by Coincidental Cohesion?
A: The reader may infer dependencies which are not there.

Q: Which problems are caused by Sequential Cohesion?
A: A module may contain several functions or just part of a function, which are less likely to be usable from other parts of the system.

Q: Which problems are caused by Very small modules?
A: Modules with a small number of statements may not perform an entire function, hence may not have Functional Cohesion.

Q: Which problems are caused by Large modules?
A: Large modules may include more than one function, hence may not have Functional Cohesion.