Open In App

GATE | GATE CS 2013 | Question 65

Like Article
Like
Save
Share
Report

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


Last Updated : 14 Feb, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads