Regression and Sanity Testing

MANUAL TESTING

6/16/20233 min read

person using silver laptop computer on desk
person using silver laptop computer on desk

"Regression" and "sanity" are two different concepts in the context of software development and testing.

Regression Testing: Regression testing is a type of software testing that aims to ensure that changes or enhancements to an application do not unintentionally introduce new bugs or regressions into the existing functionality. It involves retesting the previously tested features to make sure they still work as expected after making changes to the software. Regression testing is typically performed as part of the software development lifecycle to maintain the quality and stability of the application.

Sanity Testing: Sanity testing, also known as smoke testing, is a quick and focused type of software testing that verifies whether the most critical functionalities of an application or system are working as expected. It is performed when a new build or version of the software is ready for further testing. The purpose of sanity testing is to conduct a preliminary evaluation of the software to determine if it is stable enough to proceed with more comprehensive testing. Sanity testing helps to identify major issues early on, allowing the testing team to decide whether the build is suitable for further testing or if it requires more immediate attention.

In summary, regression testing focuses on ensuring that previously tested functionality continues to work correctly after changes, while sanity testing verifies the basic functionality and stability of a new build or version before proceeding with more extensive testing. Both types of testing play important roles in software development to maintain quality and minimize the risk of introducing defects.

Regression Testing Example:

Let's say you have developed a software application for an e-commerce website that calculates the total cost of a customer's purchase, including taxes and shipping charges. Regression testing is performed to ensure that any changes or updates made to the application do not introduce new bugs or regressions.

Scenario:

You recently made a bug fix in the tax calculation logic of the application. To perform regression testing, you would follow these steps:

Identify a set of test cases that cover various scenarios and functionalities of the application related to calculating the total cost, taxes, and shipping charges.

Execute these test cases on the previous version of the application to establish a baseline of expected behavior and record the test results.

Deploy the updated version of the application with the bug fix.

Re-execute the same set of test cases on the updated version and compare the results with the baseline.

If the test results match the baseline, it indicates that the bug fix did not introduce any new issues, and the regression testing is considered successful. Otherwise, if any test case fails, it indicates a regression, and the issue needs to be investigated and fixed.

Sanity Testing Example:

Sanity testing, also known as smoke testing, is performed to quickly evaluate the stability and basic functionality of an application after a new build or release.

Scenario:

You have developed a mobile application for a social media platform that allows users to post text, images, and videos. For sanity testing, you would follow these steps:

Install the newly built version of the mobile application on a test device.

Launch the application and check if it opens without any critical errors or crashes.

Perform basic operations such as creating a new post, uploading an image or video, and viewing posts from other users.

Ensure that the core functionalities of the application are working as expected, such as liking or commenting on posts, searching for users, and updating profile information.

Verify that any critical bugs reported in the previous build have been fixed.

If the application passes these basic tests without any major issues, it is considered to have passed the sanity testing phase.

Both regression testing and sanity testing are essential to ensure the quality and reliability of software applications. Regression testing focuses on detecting regressions or unintended changes in behavior, while sanity testing helps quickly validate the basic functionality and stability of an application.