Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
What is Data Structure Metrics?
3.
Data Structure metrics to evaluate effort and time
4.
FAQs
5.
Key Takeaways
Last Updated: Mar 27, 2024

Data Structure Metrics

Introduction

A metric is defined as a quantitative measure of the degree to which a system, component, or process possesses a given attribute. Software metrics is the application of measurement techniques to the software characteristic processes or the degree to which a software system possesses a property. The use of software metrics to provide quantitative checks on software systems is a well-established area.

What is Data Structure Metrics?

Whenever we develop software or perform an activity in the software system, we process some data. Some data are input to the system, program, or module; some are used internally, and some are output from the system, program, or module. The basic set of metrics that captures and calculates the amount of data input to, internally processed in, and output from software is called Data Structure Metrics.

For example, we have a software planner that considers the following data as-.

Input:

  • Size of software
  • Input duration
  • No. of developers needed for the software
     

Intermediate/Internal data:

  • Cost of each developer
  • Other factors depend on the circumstances and conditions of the organisation.
     

Output:

  • Efforts put
  • Duration of output
  • Estimated Cost of output 

    The work of Data structure Metrics is to basically keep a count of these data. Some Data metrics focus primarily on variables and given constants within each module & ignore the input-output dependencies. Others concern themselves with input/output situations.
    Also read - Data Structure MCQ

Data Structure metrics to evaluate effort and time

Some data structure metrics required to evaluate the effort and time needed for developing software are:

  1. The amount of Data.
  2. The Usage of data within a component.
  3. Program weakness.
  4. The sharing of Data among components. 

 

1. The Amount of Data: There are additional metrics to measure the amount of data which are:

  • Number of variables (VARS):  The number of variables used in the program is counted in this metric.
  • Number of Operands (η2): The number of operands used in the program is counted in this metric.
  • η2 = VARS + unique constants + Labels
  • Total number of occurrences of the variable (N2): The total number of occurrences of the variables are computed in this metric.

     

2The Usage of data within a Component: The average number of live variables is calculated to compute this metric. A variable is live from its first to its last references within the procedure. 

The average number of live variables is the sum of the count of live variables divided by the count of executable statements in a procedure.

For Example, the following equation can calculate the average number of live variables for a program having modules.

Here, LV is the average live variable metric calculated from the ith module. 

The equation that gives the average span size for a program of n spans-

3. Program weakness: The weakness of a program depends on its module's weakness. If modules are weak, they tend to be less cohesive, increasing the effort and time metrics required to complete the project.

Module Weakness (WM) = LV* γ, where γ = Average life variables

A program is usually a combination of various modules; hence, program weakness can be a useful measure and is given as:

Here, WM: Weakness of the ith module, WP: Weakness of the program and m: No. of modules in the program.


4. The Sharing of Data among Modules:  A program contains modules and they share modules among each other. The increased data sharing between modules leads to high coupling. Hence, the number of parameters passing between modules also increases. As a result, more effort and time are required to complete the project. So sharing data among modules is a vital metric to calculate effort and time. 


Also read  V Model in Software Engineering, Introduction to Software Engineering

FAQs

  1. What do Data Structure Metrics do?
    The Data Structure Metrics captures and calculates the amount of data input to, internally processed in, and output from the software
     
  2. Explain what a live variable is?
    A variable can be live from the beginning of its reference to its last in a procedure. A variable is live at a point if it holds a value that may be needed in the future, or equivalently if its value may be read before the next time the variable is written.
     
  3. What is the basic formula to find the LV of a component?
    The average number of live variables is the sum of the count of live variables divided by the count of executable statements in a procedure

Key Takeaways

In this article, we have extensively discussed Data Structure Metrics, associated terminologies and implementation, and some questions related to this topic. We hope that this blog has helped you enhance your knowledge and if you wish to learn more, check out our Information Flow MetricsCoding Ninjas Blog site and visit our Library. You can also consider our Online Coding Courses such as the DSA in PythonC++ DSA CourseDSA in Java Course to give your career an edge over others.

Do upvote our blog to help other ninjas grow.

Happy Learning! 

Live masterclass