Information Flow Metrics
Information Flow Metrics
Information flow metrics are applied to components of a system design to measure complexity and interdependence based on how information flows between them (Henry & Kafura, 1981). Understanding information flow helps in:
- Complexity analysis – evaluating the complexity of inter-module communication.
- Dependency management – identifying and managing dependencies to avoid tight coupling.
- Testing and maintenance – prioritising components for testing and maintenance based on flow-related risk.
Elements of Information Flow
- Component – any distinct unit of a software system (for example, a module, class, or subsystem) that interacts with others through function calls, data exchange, or control signals.
- Cohesion – the degree to which the elements within a single component are related and work together to perform a single, well-defined task. High cohesion is desirable because such components are focused, easier to maintain, and less error-prone.
- Coupling – the degree of dependency between components. High coupling means components are strongly linked and harder to change in isolation; low coupling means components are more independent and the system is easier to understand and extend.
Figure 17: Components of a system design – modules connected by calls and data flow.
Basic Information Flow Model
The basic information flow model measures the interaction between modules using two primary metrics: fan-in and fan-out. Consider a design fragment as in Figure 17 and a component A.
- Fan-in – the number of other components that call or pass control to a given component.
- Fan-out – the number of components that are called by the given component.
Modules with high fan-in are often highly reused and relatively stable, but they can become bottlenecks. High fan-out can lead to tight coupling, making changes and testing more difficult.
Henry and Kafura define the information flow complexity (or information flow index) of a component A as:
Higher values of CP(A) indicate components that are both widely used and heavily dependent on others, and are therefore more complex and risky.
Steps to Calculate Basic Information Flow Metrics
- Identify components – decompose the system into its constituent components or modules and identify the hierarchical level of each component (top-level components are at the highest level).
-
For each component:
- Count the number of calls to the component to obtain fan-in. For a top-level component (which would otherwise have fan-in 0), assign a fan-in of 1.
- Count the number of calls from the component to obtain fan-out. For leaf components (which do not call others), assign a fan-out of 1.
- Compute the information flow index CP(A) using the formula above.
- Level sums – sum the CP values of all components within each hierarchical level to get a level sum.
- System-wide aggregation – sum all level sums to obtain a system sum for the entire design.
- Ranking and visualisation – rank components at each level by fan-in, fan-out, and CP(A); plot histograms or line graphs of level sums across levels to identify high-complexity areas in the architecture.
Extended Information Flow Model
The extended information flow model refines the basic model by considering not only calls between components but also the number of parameters passed and the data elements read or written by each component.
For a component A, let:
- a – number of components that call A.
- b – number of parameters passed to A from higher-level components.
- c – number of parameters passed to A from lower-level components.
- d – number of data elements read by A.
The extended fan-in of A is then:
Similarly, let:
- e – number of components called by A.
- f – number of parameters passed from A to higher-level components.
- g – number of parameters passed from A to lower-level components.
- h – number of data elements written by A.
The extended fan-out of A is:
These extended measures provide a more detailed picture of how both control and data flow through the system, beyond simple call counts.
Using Information Flow Metrics
By analysing fan-in, fan-out, and the resulting information flow complexity, developers and architects can:
- Identify potential bottlenecks and high-risk modules.
- Assess the system’s modularity and degree of coupling.
- Prioritise components for redesign, refactoring, or intensive testing.
Information flow metrics are therefore an important tool for designing maintainable and scalable software systems.