> For the complete documentation index, see [llms.txt](https://qatesting.gitbook.io/qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://qatesting.gitbook.io/qa/manual-testing/types/black-box-testing/functional-testing/system-testing/regression-testing.md).

# Regression Testing

Regression testing can be performed on a new build when there is a significant change in the original functionality. It ensures that the code still works even when the changes are occurring.

{% hint style="info" %}
Regression means **Re-test** those parts of the application, which are *unchanged*.
{% endhint %}

## What is regression testing?

👩🏻‍💻 Regression testing involves re-running existing test cases after code changes to verify that previous functionality still works correctly. Regression testing is a black box testing techniques. It is used to authenticate a code change in the software does not impact the existing functionality of the product. Regression testing is making sure that the product works fine with new functionality, bug fixes, or any change in the existing feature.

## Why is regression testing needed?

👩🏻‍💻 Any change to software - like defect fixes or new features - runs the risk of breaking existing functionality. Regression testing aims to detect these regressions before the software is released.

## Types of regression testing

👩🏻‍💻 There are two main types:

**✅ Regression (Fix)** - Focused testing around recently fixed defects to verify those fixes

* Done after defects are fixed by developers
* Testers rerun test cases that cover:
* The specific defect fix
* Any potentially related functionality
* Testers have a good understanding of:
* The exact defect
* Which tests cover that functionality
* The aim is to verify the defect fix
* Typically a focused, targeted set of test cases
* Usually a shorter testing cycle

**✅ Regression (Risk)** - Broader testing based on impact and risk analysis to identify unintended side effects

* Done on subsequent builds after code changes
* Testers perform impact and risk analysis based on:
* Number and types of code changes
* Complexity of changes
* Defect density in changed code
* The aim is to identify any unintended consequences or regressions
* The broader set of test cases selected to cover:
* Functionality most at risk of being affected
* High priority features
* Typically a more comprehensive regression test suite
* Aims for higher test coverage to catch side effects
* Usually a longer testing cycle with more test cases

**Regression as a fix** 🐞 refers to when developers fix an existing issue that has caused the software to regress, or become worse than before. 📉 The goal is to bring functionality back up to where it was.

**Regression as a risk** 🚨 refers to the potential that new code changes could unintentionally introduce regressions, or bugs, that degrade existing functionality. 🤯

{% hint style="warning" %}
Regression as a fix deals with known issues, while regression as a risk deals with potential unknown issues. 💡
{% endhint %}

## What is the regression testing process?

👩🏻‍💻 The process typically involves:

1. Reviewing code changes
2. Identifying test cases impacted based on location and type of changes
3. Prioritizing test cases based on risk and impact
4. Executing test cases on the new build
5. Logging any failures as new defects
6. Iteratively performing regression testing after each build

## What are the benefits of regression testing?

👩🏻‍💻 The main benefits are:

👍 Ensuring existing functionality still works properly after changes

👍 Detecting software regressions before release

👍 Gaining confidence that changes have not disrupted the system

### When can we perform Regression Testing?

We do regression testing whenever the production code is modified.

We can perform regression testing in the following scenario, these are:

**1. When new functionality added to the application.**

**Example:**

A website has a login functionality which allows users to log in only with Email. Now providing a new feature to do login using Facebook.

**2. When there is a Change Requirement.**

**Example:**

Remember password removed from the login page which is applicable previously.

**3. When the defect fixed**

**Example:**

Assume login button is not working in a login page and a tester reports a bug stating that the login button is broken. Once the bug fixed by developers, tester tests it to make sure Login Button is working as per the expected result. Simultaneously, tester tests other functionality which is related to the login button.

**4. When there is a performance issue fix**

**Example:**

Loading of a home page takes 5 seconds, reducing the load time to 2 seconds.

**5. When there is an environment change**

**Example:**

When we update the database from MySql to Oracle.

### Advantages of Regression Testing

* Regression Testing increases the product's quality.
* It ensures that any bug fix or changes do not impact the existing functionality of the product.
* Automation tools can be used for regression testing.
* It makes sure the issues fixed do not occur again.

### Disadvantages of Regression Testing

* Regression Testing should be done for small changes in the code because even a slight change in the code can create issues in the existing functionality.
* If in case automation is not used in the project for testing, it will time consuming and tedious task to execute the test again and again.

## Retesting vs Regression Testing: Key Differences <a href="#toc4" id="toc4"></a>

<table data-full-width="true"><thead><tr><th>Retesting</th><th>Regression Testing</th></tr></thead><tbody><tr><td>Retesting has tests explicitly designed to check whether known bugs have been fixed.</td><td>Regression testing isn’t targeted testing for known defects.</td></tr><tr><td>Retesting does not focus on the previous version’s functionality. Instead, it aims to check whether functionality has been restored following a bug fix.</td><td>Regression testing is change-oriented and mainly aims to check whether the previous versions’ functionality is maintained following a change/update to the application.</td></tr><tr><td>Since retesting checks for a specific defect, it can’t be automated. </td><td>Automation is prevalent for regression testing. Manual testing every time a change or update is made to an application would be very irrational. Automation is far more complementary to carrying out blanket tests for unintended bugs.</td></tr><tr><td>Retesting doesn’t have to be a part of the testing process unless a bug is found and corrected; Therefore, retesting is not a guaranteed part of the testing process.</td><td>Regression testing is the norm and is always a part of the testing process. Every time the application’s code is altered, it is good practice to perform regression testing.</td></tr><tr><td>A higher priority is applied to retesting since this testing focuses on fixing <em>known</em> defects.</td><td>Regression testing has a lower priority than Retesting since it simply conducts a sweep of the application to check for <em>potential</em> unanticipated defects.</td></tr><tr><td>Since only a certain defect is explored in retesting it is far less time-consuming.</td><td>Regression testing often explores large parts of the application to uncover bugs and can be more time-consuming than retesting.</td></tr></tbody></table>

* **The core difference between Retesting and Regression Testing** is that retesting is meant to check for known bugs and is used to reaffirm that the bug in question has been fixed generally.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://qatesting.gitbook.io/qa/manual-testing/types/black-box-testing/functional-testing/system-testing/regression-testing.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.
