Measuring coupling and cohesion of software modules: an information-theory approach
Edward B. Allen, Taghi M. Khoshgoftaar, Yuan-Tsong Chen · 2002
Coupling of a subsystem characterizes its interdependence with other subsystems. A subsystem's cohesion, on the other hand, characterizes its internal interdependencies. When used in conjunction with other attributes, measurements of a subsystem's coupling and cohesion can contribute to software quality models. An abstraction of a software system can be represented by a graph, and a module (subsystem) by a subgraph. Software design graphs depict components and their relationships. E.B. Allen and T.M. Khoshgoftaar (1999) proposed information theory-based measures of coupling and cohesion of a modular system. This paper proposes related information theory-based measures of coupling and cohesion of a module. These measures have the properties of module-level coupling and cohesion defined by Briand, Morasca and Basili (1997, 1999) . We define cohesion of a module in terms of intra-module coupling, normalized to between zero and one. We illustrate the measures with example graphs and an empirical analysis of the call graph of a moderate-sized C program, the Nethack computer game. Preliminary analysis showed that the information-theory approach has finer discrimination than counting.