Sanity Check: How To's, Benefits, Features, And More

Nishil Patel

Nishil Patel

Jan 25, 2024

5 min read

Share

Sanity Check: How To's, Benefits, Features, And More

A sanity check is a quick test you run after adding new features or squashing bugs in software. It’s all about making sure the software acts in a way that makes sense. It’s a nifty tool for QA engineers who need to do a fast check on key functions. In this article, you’re gonna learn how to do these checks and what you have to keep an eye out for.

Table of Contents

1.

Introduction

2.

What is a Sanity Check?

3.

When to Run a Sanity Check?

4.

How To Run a Sanity Check?

5.

FAQs

Introduction

Every time a fresh feature is introduced or a bug is squashed in software, it needs to be checked out. Before you get into the nitty-gritty of testing, a swift validation for these new features or fixes can give you a solid head start.

That’s where a sanity check steps in, helping you conduct these speedy tests and validations. So, what exactly is a sanity check? How do you go about running one? What makes it tick? Let’s peel back the layers of sanity checks in software, answering these questions and unpacking a whole lot more in this post.

What is a Sanity Check?

A sanity check, or sanity test, is a quick evaluation used in software testing to determine if a new feature or bug fix in a program or app is functioning as anticipated. It’s a way to test for “sanity”, which involves checking the logical behavior of new features or bug fixes in a stable software build.

As a QA engineer or tester, you might not always have the time to conduct a comprehensive test. Sometimes, you might need to swiftly assess a crucial function. So you can run a sanity check. In short, you confirm an expected behavior that needs to work fine for users in your application.

Let’s understand it better with a real-world use case of an online shopping platform:

  1. You are searching for a product and find that the product is on sale at a great discount.
  2. You might think, hmm... Let’s buy 10 instead of 1 since I’m getting it at a heavy discount.
  3. You start increasing the quantity.

As soon as the quantity reaches three, a message pops up:

You can buy a maximum of 3 per user

I’m sure you must have seen this happening at some point while shopping online.

Let’s dissect this example in the context of a sanity check:

  • A sanity check could quickly ensure that the users are restricted from ordering a discounted item beyond a fixed quantity.
  • Offering discounts is a planned feature and a critical one. If users are allowed to purchase a greater quantity, it may affect business goals. A sanity check could ensure that the business goals are not affected.

Sanity checks are super useful in rapidly validating any major issues. If the test bombs, it’s a red flag for more testing and debugging.

Read More: Report Bugs Effectively: Writing Tips To Keep Developers Happy

Features of a Sanity Check

  • Quick Evaluation: Quickly checks new features or fixes, leading to fast feedback.
  • Critical Function Validation: Tests key functions to keep the software stable and intact.
  • Selective Testing: Examines new features or fixes specifically to prevent negative impact on key functions.
  • Resilience Testing: Uses negative cases to test system strength and find potential weak spots, ensuring the system can handle unusual situations.

When to Run a Sanity Check?

  • When you tweak the code slightly without affecting the software’s overall performance.
  • When you get a stable build after several regression tests to confirm that the key features are still operational.
  • After fixing bugs, to ensure that they’re gone and haven’t caused any new glitches.
  • To verify that the software is ready for release and user-friendly.
  • When the software undergoes a significant change and you need to assess if the new features make sense and work properly.

Accelerate Bug Reporting Workflows

How To Run a Sanity Check?

Let’s dive deeper into the same example of an online shopping platform that limits a customer to purchase no more than three of the same discounted item. Use this step-by-step guide to do a sanity check for quickly passing your next build out to production:

Step 1: Set the Goal and Scope

Your aim is to carry out a non-comprehensive review of a specific feature—that is—to run a sanity check on your online platform when offering products at markdowns. The user can only purchase up to three if that item is on sale. This feature is fresh and crucial, so it has to work correctly.

Step 2: Identify Critical Functions

First, focus on testing important parts when you change code for a new feature or fix a bug. These features need to work right in a stable app.

In the context of an online shopping platform, this could include:

  • Discount logic
  • Ability to place orders
  • Process payments
  • Manage user accounts

Step 3: Execute the Sanity Check

After you have identified the critical function, which is:

  • Ensure quantity restrictions of up to three for discounted items.

Follow these steps to do a sanity check:

  1. Select the Feature: Focus on the recently added feature or bug fix. For example, check for quantity restrictions for discounted items.
  2. Positive Test Case: Verify that the feature works as expected under normal conditions. For example, confirm that users can add discounted items and place orders within the allowed quantity.
  3. Negative Test Case: Test the feature's resilience to misuse or unexpected behavior. For example, attempt to place an order exceeding the specified quantity and ensure the system correctly restricts the user and displays an appropriate message.
  4. Boundary Tests: Check the extremes. For example, verify the feature's behavior when ordering the minimum and maximum allowed quantities.

Step 4: Document and Create Bug Reports to Share

If everything works as expected, document the results.

Documentation is usually not required while conducting a sanity check. Still, it’s a good practice to keep a record of everything. This could prove to be important while debugging.

If any issues arise, use BetterBugs to provide detailed information on what went wrong using:

  1. Screenshots of the issue
  2. Video recordings of the issue in action
  3. Details about the unexpected behavior
  4. Developer tools and system environment information

With BetterBugs you can:

  • Capture screenshots and videos of issues to create and share context-rich bug reports.
  • Generate and send detailed bug reports with auto-included console logs, network logs, and system information with every screenshot or video recording. You can reproduce and resolve issues much faster using this information.
  • Integrate with Jira, Asana, Linear, and more to share bug reports across multiple platforms in a few clicks.
  • Collaborate and communicate easily across teams with simple workflows and a very intuitive UI.

Create Great Bug Reports Faster Than Ever

FAQs

BetterBugs contributes to improved productivity with easy bug-reporting workflows. This reduces the time and resources spent on bug reporting and debugging. Auto-inclusion of dev tools information with every screenshot or video recording helps to understand and resolve issues with better context and with important details like console logs, network requests, and much more.

Written by

Nishil Patel | CEO & Founder

Follow

Nishil is a successful serial entrepreneur. He has more than a decade of experience in the software industry. He advocates for a culture of excellence in every software product.

Subscribe to our updates

Meet the Author: Nishil Patel, CEO, and Co-founder of BetterBugs. With a passion for innovation and a mission to improve software quality.

We never spam.

Nothing here!
Show us some love 💖. Try BetterBugs today if you haven’t already. A quick feedback and a rating on our Chrome web store page would be awesome!

Share your experience with the founderhere!

Don’t wait! Start reporting now.