**Metrics** simply measures quantitative assessment that focuses on countable values most commonly used for comparing and tracking performance of system. Metrics are used in different scenarios like analyzing model, design model, source code, testing, and maintenance. Metrics for design modeling allows developers or software engineers to evaluate or estimate quality of design and include various architecture and component-level designs.

**Metrics by Glass and Card :**

In designing a product, it is very important to have efficient management of complexity. Complexity itself means very difficult to understand. We know that systems are generally complex as they have many interconnected components that make it difficult to understand. Glass and Card are two scientists who have suggested three design complexity measures. These are given below :

**Structural Complexity –**

Structural complexity depends upon fan-out for modules. It can be defined as :S(k) = f

^{2}_{out}(k)Where

**f**represents fanout for module k (fan-out means number of modules that are subordinating module k)._{out}**Data Complexity –**

Data complexity is complexity within interface of internal module. It is size and intricacy of data. For some module k, it can be defined as :

D(k) = tot_var(k) / [f

_{out}(k)+1]Where

*tot_var*is total number of input and output variables going to and coming out of module.**System Complexity –**

System complexity is combination of structural and data complexity. It can be denoted as:Sy(k) = S(k)+D(k)

When structural, data, and system complexity get increased, overall architectural complexity also gets increased.

**Complexity metrics –**

Complexity metrics are used to measure complexity of overall software. The computation if complexity metrics can be done with help of a flow graph. It is sometimes called cyclomatic complexity. The cyclomatic complexity is a useful metric to indicate complexity of software system. Without use of complexity metrics, it is very difficult and time-consuming to determine complexity in designing products where risk cost emanates. Even continuous complexity analysis makes it difficult for project team and management to solve problem. Measuring Software complexity leads to improve code quality, increase productivity, meet architectural standards, reduce overall cost, increases robustness, etc. To calculate cyclomatic complexity, following equation is used:

Cyclomatic complexity= E - N + 2

Where, E is total number of edges and N is total number of nodes.

**Example –**

In diagram given below, you can see number of edges and number of nodes.

So, the Cyclomatic complexity can be calculated as –

Given, E = 10, N = 8 So, Cyclomatic complexity = E - N + 2 = 10 – 8 + 2 = 4

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

## Recommended Posts:

- Product Metrics in Software Engineering
- Software Engineering | Halstead’s Software Metrics
- Software Engineering | Identifying Software Development Metrics
- Software Measurement and Metrics
- Extended Function Point (EFP) Metrics
- Short Note on Function-Oriented Metrics
- Short Note on Size-Oriented Metrics
- Measuring Software Quality using Quality Metrics
- Core Metrics to Manage Modern Process
- Inspection Metrics in Software Engineering
- Software Engineering | Pham-Nordmann-Zhang Model (PNZ model)
- Difference between Waterfall Model and Spiral Model
- Difference between Waterfall model and Incremental model
- Difference between V-model and Waterfall model
- Difference between RAD Model and Waterfall Model
- Difference between Agile Model and V-Model
- Difference between Prototype Model and Spiral Model
- Difference between Spiral model and Incremental model
- Difference between Prototype Model and RAD Model
- Difference between RAD Model and Incremental Model

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.