# Test metrics

Before starting what is Software Test Metrics and types, I would like to start with the famous quotes in terms of metrics.

> &#x20;**You can’t control what you can’t measure – Tom Demacro (an American software engineer, author, and consultant on software engineering topics).**

Software test metrics is to monitor and control process and product. It helps to drive the project towards our planned goals without deviation.

Metrics answer different questions. It’s important to decide what questions you want answers to.

Software test metrics are classified into two types

1. [Process metrics](https://www.softwaretestingmaterial.com/test-metrics/#ProcessMetrics)
2. [Product metrics](https://www.softwaretestingmaterial.com/test-metrics/#ProductMetrics)

### **Process Metrics:**

Software Test Metrics used in the process of test preparation and test execution phase of [STLC](https://www.softwaretestingmaterial.com/stlc-software-testing-life-cycle/).

The following are generated during the Test Preparation phase of [STLC](https://www.softwaretestingmaterial.com/stlc-software-testing-life-cycle/):

#### **Test Case Preparation Productivity:**

It is used to calculate the number of Test Cases prepared and the effort spent for the preparation of [Test Cases](https://www.softwaretestingmaterial.com/test-case-template-with-explanation/).

**Formula:**

```
Test Case Preparation Productivity = (No of Test Case)/ (Effort spent for Test Case Preparation)
```

**E.g.:**

No. of Test cases = 240

Effort spent for Test case preparation (in hours) = 10

Test Case preparation productivity = 240/10 = 24 test cases/hour

#### **Test Design Coverage:**

It helps to measure the percentage of test case coverage against the number of requirements

**Formula:**

```

Test Design Coverage = ((Total number of requirements mapped to test cases) / (Total number of requirements)*100
```

**E.g.:**

Total number of requirements: 100

Total number of requirements mapped to test cases: 98

Test Design Coverage = (98/100)\*100 = 98%

The following are generated during the Test Execution phase of STLC:

#### **Test Execution Productivity:**

It determines the number of Test Cases that can be executed per hour

**Formula:**

```
(No of Test cases executed)/ (Effort spent for execution of test cases)
```

**E.g.:**

No of Test cases executed = 180

Effort spent for execution of test cases = 10

Test Execution Productivity = 180/10 = 18 test cases/hour

#### **Test Execution Coverage:**

It is to measure the number of test cases executed against the number of test cases planed.

**Formula:**

```
Test Execution Coverage = (Total no. of test cases executed / Total no. of test cases planned to execute)*100
```

**E.g.:**

Total no. of test cases planned to execute = 240

Total no. of test cases executed = 160

Test Execution Coverage = (180/240)\*100 = 75%

#### **Test Cases Passed:**

It is to measure the percentage no. of test cases passed

**Formula:**

```
Test Cases Pass = (Total no. of test cases passed) / (Total no. of test cases executed) * 100
```

**E.g.:**

Test Cases Pass = (80/90)\*100 = 88.8 = 89%

#### **Test Cases Failed:**

It is to measure the percentage no. of test cases failed

**Formula:**

```
Test Cases Failed = (Total no. of test cases failed) / (Total no. of test cases executed) * 100
```

**E.g.:**

Test Cases Failed= (10/90)\*100 = 11.1 = 11%

#### **Test Cases Blocked:**

It is to measure the percentage no. of test cases blocked

**Formula:**

```
Test Cases Blocked = (Total no. of test cases blocked) / (Total no. of test cases executed) * 100
```

**E.g.:**

Test Cases Blocked = (5/90)\*100 = 5.5 = 6%\
Check below video to see “Test Metrics”

### **Product metric:**

Software Test Metrics used in the process of defect analysis phase of STLC.

#### **Error Discovery Rate:**

It is to determine the effectiveness of the test cases.

**Formula:**

```
Error Discovery Rate = (Total number of defects found /Total no. of test cases executed)*100
```

**E.g.:**

Total no. of test cases executed = 240

Total number of defects found = 60

Error Discovery Rate = (60/240)\*100 = 25%

#### **Defect Fix Rate:**

It helps to know the quality of a build in terms of defect fixing.

**Formula:**

```
Defect Fix Rate = (Total no of Defects reported as fixed - Total no. of defects reopened) / (Total no of Defects reported as fixed + Total no. of new Bugs due to fix)*100
```

**E.g.:**

Total no of defects reported as fixed = 10

Total no. of defects reopened = 2

Total no. of new Bugs due to fix = 1

Defect Fix Rate = ((10 – 2)/(10 + 1))\*100 = (8/11)100 = 72.7 = 73%

#### **Defect Density:**

It is defined as the ratio of defects to requirements.

Defect density determines the stability of the application.

**Formula:**

```
Defect Density = Total no. of defects identified / Actual Size (requirements)
```

**E.g.:**

Total no. of defects identified = 80

Actual Size= 10

Defect Density = 80/10 = 8

#### **Defect Leakage:**

It is used to review the efficiency of the testing process before UAT.

**Formula:**

```
Defect Leakage = ((Total no. of defects found in UAT)/(Total no. of defects found before UAT)) * 100
```

**E.g.:**

No. of defects found in UAT = 20

No. of Defects found before UAT = 120

Defect Leakage = (20 /120) \* 100 = 16.6 = 17%

#### **Defect Removal Efficiency:**

It allows us to compare the overall (defects found pre and post-delivery) defect removal efficiency

**Formula:**

```
Defect Removal Efficiency = ((Total no. of defects found pre-delivery) /( (Total no. of defects found pre-delivery )+ (Total no. of defects found post-delivery)))* 100
```

**E.g.:**

Total no. of defects found pre-delivery = 80

Total no. of defects found post-delivery = 10

Defect Removal Efficiency = ((80) / ((80) + (10)))\*100 = (80/90)\*100 = 88.8 = 89%


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://testplace.gitbook.io/tutorials/manual-testing/manual-testing-tutorial/test-metrics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
