Discussion
The following figure represents access graphs of two modules M1 and M2. The filled circles represent methods and the unfilled circles represent attributes. If method m is moved to module M2 keeping the attributes where they are, what can we say about the average cohesion and coupling between modules in the system of two modules ?

Answer: A
The correct choice is There is no change.
Read the figure as a bipartite graph of methods and the attributes they access. Module M1 has 4 methods, 4 attributes and 8 arrows inside it, plus 2 arrows from method m into M2's attributes. Module M2 has 3 methods, 4 attributes and 6 arrows inside it. Measure cohesion as the fraction of possible method-to-attribute links that exist inside the module:
\[ \begin{aligned} \text{before, } M1 &= \tfrac{8}{4 \times 4} = 0.5 \\ \text{before, } M2 &= \tfrac{6}{3 \times 4} = 0.5 \end{aligned} \]
Move m to M2. Its 2 arrows into M2's attributes become internal and its 2 arrows into M1's attributes now cross the boundary:
\[ \begin{aligned} \text{after, } M1 &= \tfrac{6}{3 \times 4} = 0.5 \\ \text{after, } M2 &= \tfrac{8}{4 \times 4} = 0.5 \end{aligned} \]
Coupling is the number of arrows that cross between the modules: 2 before and 2 after. Both cohesion figures and the coupling are unchanged, so the other three options, which claim a change, are wrong.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development