cohesion and coupling Flashcards

1
Q

What is cohesion in software modules?

A

Cohesion is the manner and degree to which the tasks performed by a single software module are related to one another within a single module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How many types of cohesion are there?

A

There are 7 types of cohesion.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define Communicational Cohesion.

A

The tasks performed by a module use the same input data or contribute to producing the same output data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Is Communicational Cohesion acceptable?

A

Yes, it is always acceptable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Define Functional Cohesion.

A

The tasks performed by a module all contribute to the performance of a single function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the significance of Functional Cohesion?

A

It is the foundation of object-oriented programming.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define Logical Cohesion.

A

The tasks performed by a module perform logically similar functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Is Logical Cohesion generally considered good?

A

No, it is generally considered bad.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define Procedural Cohesion.

A

The tasks performed by a module all contribute to a given program procedure such as an iteration or decision process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Is Procedural Cohesion considered good?

A

Rarely considered good.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Define Sequential Cohesion.

A

The output of one task performed by a module serves as the input to another task performed by the module.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Is Sequential Cohesion acceptable?

A

No, it is never acceptable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define Temporal Cohesion.

A

The tasks performed by a module are all required at a particular phase of program execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Is Temporal Cohesion acceptable?

A

No, it is never acceptable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Define Coincidental Cohesion.

A

The tasks performed by a module have no functional relationship to each other.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Is Coincidental Cohesion acceptable?

A

No, it is never acceptable.

17
Q

What is coupling in software modules?

A

Coupling is the manner and degree of interdependence between modules.

18
Q

Define Common-environment coupling.

A

Type of coupling in which two software modules access a common data area.

19
Q

Is Common-environment coupling acceptable?

A

Yes, as long as modules are not operating on global data.

20
Q

Define Content Coupling.

A

Type of coupling in which some or all of the contents of one software module are included in the contents of another module.

21
Q

Provide an example of Content Coupling.

A

Lambda functions in C++ or Python, or event listeners.

22
Q

Define Control Coupling.

A

Type of coupling in which one software module communicates information to another module for the explicit purpose of influencing the latter module’s execution.

23
Q

Is Control Coupling considered good?

A

No, it is considered bad.

24
Q

Define Data Coupling.

A

Type of coupling where output from one module serves as input to another module.

25
Is Data Coupling acceptable?
Yes, as long as the receiving function does the same thing with any input data.
26
Define Hybrid Coupling.
Type of coupling in which different subsets of the range of values that a data item can assume are used for different and unrelated purposes in a different software module.
27
Is Hybrid Coupling considered good?
No, it is considered bad.
28
Define Pathological Coupling.
Type of coupling in which one module affects or depends upon the internal implementation of another.
29
Is Pathological Coupling desirable?
No, it is not desirable except perhaps in performative programming.