DATA STRUCTURE METRICS

Divya Srinivasan

Data Structure Metrics

In software development and related activities, the primary objective is to process data. Some data serves as input to a system, program, or module; some is utilized internally during processing, and some is produced as output from the system, program, or module.


That is why an important set of metrics focuses on measuring the amount of data input, processed, and produced as output in software. This measurement, known as Data Structure Metrics, concentrates on variables (and given constants) within each module, while ignoring input–output dependencies.

Data Structure Metrics help estimate the effort and time required to complete a project. The key metrics include:
  • Amount of Data
  • Usage of Data within a Module
  • Program Weakness
  • Sharing of Data among Modules

1. Amount of Data

To measure the amount of data, several metrics can be used:
  • Number of Variables (VARS): Counts the total number of variables used in the program.
  • Number of Operands (η₂): Counts the total number of operands used in the program.
                              𝜂2 = VARS+Constants+Labels
  • Total Number of Occurrences of Variables (N₂): Counts how many times variables appear throughout the program.

2. Usage of Data within a Module

This metric measures the average number of live variables in a module.
  • A live variable is one that is active from its first reference to its last reference within a procedure.
  • For a program with multiple modules, the average number of live variables can be calculated using:
                 n
         LV=∑ LVi / n
                i=1
           ​
Where:
  • LVi = Average live variables in the ith module
  • n = Number of modules
Similarly, the average span size (SP) can be computed for a program with n spans using a similar formula.

3. Program Weakness

Program weakness depends on the weakness of its modules:
  • Weak modules (less cohesive) require more effort and time to complete.
  • Module Weakness (WM) can be measured as:                                  
                               WM=LV×γ
Where:
  • LV = Average live variables in the module
  • γ = Weighting factor
The overall Program Weakness (WP) is given by:
Where:
  • WMi = Weakness of the ith module
  • m = Number of modules in the program

4. Sharing of Data among Modules

When data sharing between modules increases (i.e., higher coupling), parameter passing between modules also rises. This results in greater effort and time requirements to complete the project. Therefore, data sharing among modules is an important metric for estimating project effort and duration.




Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send