A2.6 Coupling Metrics

A2.6 Coupling Metrics

Coupling reflects the degree of relationship that exists between modules. The more coupled two modules are, the more dependent they become on each other. Coupling is an important measurement domain because it is closely associated with the impact that a change in a module (or also a fault) might have in the rest of the system.

There are many different attributes that relate specifically to the binding between program modules at runtime. These attributes are related to the coupling characteristics of the module structure. For our purposes, we will examine two attributes of this binding process: (1) the transfer of program control into and out of the program module, and (2) the flow of data into and out of a program module.

The flow of control among program modules can be represented in a program call graph. This call graph is constructed from a directed graph representation of program modules that can be defined as follows:

  • A directed graph, G = (N, E, s), consists of a set of nodes N, a set of edges E, and a distinguished node s, the main program node. An edge is an ordered pair of nodes (a, b).

  • There will be an edge (a, b) if program module a can call module b.

  • As was the case for a module flowgraph, the in-degree I(a) of node a is the number of entering edges to a.

  • Similarly, the out-degree O(a) of node a is the number of exiting edges from a.

The nodes of a call graph are program modules. The edges of this graph represent calls from module to module and not returns from these calls. Only the modules that are constituents of the program source code library will be represented in the call graph. This call graph will specifically exclude calls to system library functions.

Coupling reflects the degree of relationship that exists between modules. The more tightly coupled two modules are, the more dependent they become on each other. Coupling is an important measurement domain because is closely associated with the impact that a change in a module (or also a fault) might have on the rest of the system. Several program attributes are associated with coupling. Two of these attributes relate to the binding between a particular module and other program modules. There are two distinct concepts represented in this binding: (1) the number of modules that can call a given module, and (2) the number of calls out of a particular module. These will be represented by the fan-in and fan-out metrics, respectively.

A2.6.1 F1

This metric enumerates the total number of local function calls made from a given module. Local functions do not include calls to the C standard library.

A2.6.2 f1

This metric is a count of the unique number of C function calls made within a program module to another C function. This metric is incremented only when a function call appears for the first time. If the same function is called more than once, this metric will remain unchanged.

A2.6.3 F2

This metric counts the total number of standard C function calls made into a given module. It is the total number of times that a module is invoked by all other program modules. There might, for example, be multiple calls into a module from a single program module. Each of these would increment the F2 metric.

A2.6.4 f2

This metric counts the unique number of standard C function calls into a given module. This metric is incremented only when the standard C function call appears for the first time in a particular module. If the same function is called more than once within a given program module, the f2 metric will remain unchanged.



Software Engineering Measurement
Software Engineering Measurement
ISBN: 0849315034
EAN: 2147483647
Year: 2003
Pages: 139

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net