Coupling-and-Cohesion

Question 1

The coupling between different modules of a software is categorized as follows:

    I. Content coupling
    II. Common coupling
    III. Control coupling
    IV. Stamp coupling
    V. Data coupling

Coupling between modules can be ranked in the order of strongest (least desirable) to weakest (most desirable) as follows:

A
I-II-III-IV-V
B
V-IV-III-II-I
C
I-III-V-II-IV
D
IV-II-V-III-I
Question 1 Explanation: 
Note: Out of syllabus. [Software Engineering]
Question 2
Module design is used to maximize cohesion and minimize coupling. Which of the following is the key to implement this rule?
A
Inheritance
B
Polymorphism
C
Encapsulation
D
Abstraction
Question 3
In a class definition with 10 methods, to make the class maximally cohesive, number of direct and indirect connections required among the methods are
A
90, 0
B
45, 0
C
10, 10
D
45, 45
Question 3 Explanation: 
Methods a and b are related if:
They both access the same class-level variable, or
The call trees starting at a and b access the same class-level variable.
When 2 methods are related this way, we call them directly connected.
When 2 methods are not directly connected, but they are connected via other methods, we call them indirectly connected. Example: A - B - C are direct connections. A is indirectly connected to C (via B).
TCC tells the "connection density", so to speak (while LCC is only affected by whether the methods are connected at all). TCC=LCC=1 is the maximally cohesive class where all methods are directly connected to each other.
Consider a class with N public methods. Let NP be the maximum number of public method pairs : NP = [N * (N – 1)] / 2.
= [10*(9)] / 2
= 90/2
= 45
For Directed Connections:
Let NDC be the number of direct connections between public methods. Then TCC is defined as the relative number of directly connected public methods.
Then, TCC = NDC / NP
NDC =TCC*NP
=45*1
=45
For indirect connections:
Loose Class Cohesion. Let NID be the number of indirect connections between public methods. Then LCC is defined as the relative number of directly or indirectly connected public methods. LCC = NID +NDC/ NP.
1=NID+45/45⇒ NID=0.
Question 4
Let various levels of cohesion of software modules be denoted by C,T,S, and F as given below: C: Coincidental F: Functional S: Sequential T: Temporal Which of the following ordered tuples represents correct ordering from weakest to strongest level of cohesion?
A
< T,S,C,F >
B
< C,T,S,F >
C
< C,T,F,S >
D
< C,S,F,T >
Question 5
Let various levels of cohesion of software modules be denoted by C,T,S, and F as given below: C: Coincidental F: Functional S: Sequential T: Temporal Which of the following ordered tuples represents correct ordering from weakest to strongest level of cohesion?
A
< T,S,C,F >
B
< C,T,S,F >
C
< C,T,F,S >
D
< C,S,F,T >
Question 6

Most Undesirable Type of Coupling is

A
Data Coupling
B
Control Coupling
C
Stamp Coupling
D
Content Coupling
There are 6 questions to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access