Skip to content
Related Articles
Open in App
Not now

Related Articles

GATE | GATE CS 2013 | Question 65

Improve Article
Save Article
  • Difficulty Level : Hard
  • Last Updated : 14 Feb, 2018
Improve Article
Save Article

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?

gatecs201315

(A) There is no change.
(B) Average cohesion goes up but coupling is reduced.
(C) Average cohesion goes down and coupling also reduces.
(D) Average cohesion and coupling increase.


Answer: (A)

Explanation: Answer is “No Change”

Cohesion refers to the degree to which the elements of a module belong together.

Coupling is the manner and degree of interdependence between software modules

Coupling between M1 and M2 = (Number of external links) / 
                             (Number of modules) 
                           = 2/2
                           = 1

Cohesion of a module = (Number of internal links) / 
                       (Number of methods)
                   

Cohesion of M1 = 8/4 = 2
Cohesion of M2 = 6/3 = 2


After moving method m to M2, we get following
cohesion_coupling

Coupling = 2/2 = 1
Cohesion of M1 = 6/3 = 2
Cohesion of M2 = 8/4 = 2 


Quiz of this Question

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!