Did you know Smoke, Sanity, and Regression Testing?

Yobi Bina Setiawan
28 Jan 2025 ยท DEV and QA

Five years ago, my boss asked me this question, and I had no idea what the answer was. ๐Ÿคฃ๐Ÿ˜‚๐Ÿ˜…, Let's Learn!

1. Smoke Testing

  • Definition: Smoke testing is a preliminary type of testing conducted to check whether the basic functionalities of an application are working as expected. It is like a "health check" for the software build.
  • Purpose: To verify if the most crucial parts of the system are functioning correctly before doing more in-depth testing.
  • Scope: It covers only the core functionalities. If the smoke test fails, the build is rejected, and no further detailed testing is done until the build is stable.

Why It's Important:

  • Ensures that the build is stable enough for further testing.
  • Saves time by quickly identifying major issues early on in the development cycle.
  • Helps identify issues that could block further testing (e.g., login failures, crashes).

Case Study:

  • Imagine a team working on a new mobile app. The developers release a new version with significant changes. Smoke testing is performed by the QA team to ensure that the app's basic functions, like opening the app, logging in, and accessing the main menu, are working properly before proceeding with functional testing.

2. Sanity Testing

  • Definition: Sanity testing is a narrow and focused type of testing that checks specific functionalities after a minor change or bug fix. It verifies that the changes made in the application are working as expected.
  • Purpose: To quickly verify that specific functionalities are working after changes (without running a full set of tests).
  • Scope: It has a smaller scope compared to smoke testing and focuses on a particular area of the application.

Why It's Important:

  • Helps confirm that the specific bug or issue has been fixed.
  • Provides confidence that the fix didn't break anything else in the application.
  • Reduces the need for running full tests when only minor changes have been made.

Case Study:

  • A software team fixes a bug related to the login page where users were unable to reset their passwords. After the fix, the QA team performs sanity testing to ensure that the password reset functionality works properly without executing the entire test suite for the application.

3. Regression Testing

  • Definition: Regression testing is performed to ensure that new changes or bug fixes have not negatively affected existing functionalities of the application. This type of testing re-executes previously conducted tests to verify that new code does not introduce new errors.
  • Purpose: To detect any unintended side effects introduced by new changes.
  • Scope: It covers a broad scope and ensures that the entire system (or significant parts of it) continues to work as expected after updates.

Why It's Important:

  • Ensures that new changes do not disrupt existing features.
  • Helps maintain stability in the application as it evolves.
  • Identifies regressions early, preventing major issues from reaching production.

Case Study:

  • A company adds a new feature to its e-commerce website that allows users to sort items by price. Regression testing is performed afterward to ensure that the existing features, such as the shopping cart and payment gateway, are still functioning correctly and that the new sorting feature works as expected.

Summary of Differences:

AspectSmoke TestingSanity TestingRegression Testing
DefinitionVerifying the basic functionalities of the build.Verifying specific fixes or changes made.Ensuring that new changes do not break existing features.
ScopeBroad, covering core functionality.Narrow, focused on specific functionalities.Comprehensive, covering the full system or significant parts.
When to PerformAt the beginning of testing on a new build.After bug fixes or minor changes are applied.After updates, patches, or new features are added.
PurposeTo ensure the stability of the build for further testing.To ensure that a fix or change works without breaking other parts.To ensure that no new issues are introduced in the system.
Time ConsumingQuick and takes little time.Quick and focuses only on recent changes.More time-consuming as it may involve large portions of the system.
ImportanceSaves time by identifying major issues early.Ensures that specific fixes work correctly.Prevents unintended side effects and ensures system stability.

Why All Three Are Important:

  • Smoke testing ensures that the build is stable enough for further testing.
  • Sanity testing confirms that changes or bug fixes are working correctly and didn't break anything critical.
  • Regression testing ensures that the integrity of the application is maintained over time, preventing new changes from introducing bugs.

By performing these three types of testing, the development and QA teams can ensure that the software is of high quality and free from critical issues that would impact the user experience.

Keep Healthy and Happy Coding! ๐Ÿ˜‰