Today's Offer - QA Certification Training - Enroll at Flat 20% Off.

- QA Testing Blogs -

Sanity Testing Tutorial Guide for Beginner

Testing is necessary for the effective performance of a software application because it ensures that the application should not result in any failures. Testing is performed in a de rigueur manner to point out defects and errors that were modeled during the development of the software. Mistakes can be expensive, as well as dangerous. It is always good to check everything and anything a developer produces because things can anytime go wrong. Sanity testing is among those software testing techniques in which basic tests are performed by a test team. In this post, we are going to discuss the following-

What is Sanity Testing?

Software testing is performed by combining a few of the testing techniques. These are judged based on the time constraint, budget, specifications provided by client, risks involved, SRS (System Requirement Specification), the purpose of the software, and SDLC (Software Development Life Cycle). Sanity testing is also one of those techniques which follows a narrow and deep approach and focuses on detailed testing of some limited and main features. It is performed when there is a small modification or error in the functionality. Sanity testing method is focused on one or more functionalities to ensure that those are working fine, and there is no bug or error its functionality.

QA curriculum

Sanity testing is performed after Regression testing is over to rectify the bugs and errors (if any) after regression testing. It takes care of the core functionality of the software or product. The goal is to determine that the proposed functionality works roughly as per the expectations. Sanity tests are non-scripted.

Priorities of Sanity Testing:

  • Priority One- The Sanity test cases use the very basic and normal functionality, and these tests deliver high project value to both development teams and customers
  • Priority Two- The Sanity test cases deliver high project value and are executed as a part of a software testing cycle.
  • Priority Three- The Sanity test cases will be selected for regression based on the requirement.

Understand Sanity Testing with example

Example 1 (Non-technical): Well, software developers might have noticed the term “Build” in their routine. Software is made up of multiple code files, and the compilation of these combo files together is tedious. So, developers create an executable file by integrating these code files. These executable files are known as Software builds. This software builds files after compiling are then sent for testing purposes. Testing is not a small process. It’s time-consuming. But if a client is in a hurry of taking the project, then it’s a dilemma state. Either a project manager will deliver the non-tested software (which is not acceptable) or follow a quick testing approach (which is a big ‘yes’). This is where Sanity testing is done.

Example 2 (Technical):  In an e-commerce project, the main modules are- a login page, the home page, user profile page, user registration, etc. There is a defect in the login page when the password field accepts less than four alphanumeric characters, and the requirement mentions that this password field should not be below eight characters. Hence, the defect is reported by the testing team to the development team to resolve it. Then the development team fixes the reported defect and sends it to the testing team for clearance. Then the testing team checks whether the changes done are working fine or not. It is also determined if it does have an impact on other related functionalities. Now there is a functionality to update the password in the user profile page. As part of the sanity testing, a login page is validated as well as the profile page to ensure that the checks are working fine at both the places.

Read: Various Career Oriented Testing Certification

Example 3 (Real-time): Take a function named ‘Account’ of any payment site. The tester makes modifications and fixes some defects that might occur in an account function. The sanity testing executes testing on the modified function, that is, account function in payment application to check whether the function is working properly or not.

Sanity testing checks only modified or defect fixed functions, it does not check End to End functions. It is a subset of regression testing.

Key Points about Sanity Testing

  • In the Sanity testing method, the testers verify the commands, functions and the menus of the software
  • It is a subset of regression testing
  • It is done when we are short on time to perform detailed testing
  • It is non-scripted
  • It is a quick and brief testing method which ensure that the changes are working as per expectations and as per specifications of the client
  • It checks the minor fixing of bugs and the functionality to make them work intact
  • It can be created based on basic functionality
  • It can run when a project goes through some major modifications
  • Sanity test cases delivery a high project value to both software development teams and the customers

Features of Sanity Testing

Features of Sanity Testing

  1. A subset of Regression Testing:
    Sanity testing is a subset of regression testing and focuses on the smaller section of the application.
  2. Unscripted:
    Most of the times sanity testing is not scripted.
  3. Not documented:
    Usually, sanity testing is undocumented.
  4. Narrow and deep:
    Sanity testing is as narrow and deep approach to testing where limited functionalities are covered in depth.
  5. Speedy Evaluation:
    Sanity testing has a very limited focus for functionalities or areas that are to be tested. You don’t need to script the test cases before carrying out sanity testing; rather, you use an unplanned, intuitive approach to performing sanity testing.
  6. Quick-release

It gives you a quick state of the product, which can help you plan your next step accordingly. If sanity test fails, the development team has to postpone the next task and fix the flawed release first. On the other hand, if sanity test is passed, you may ask your development team to go ahead with the next task while keeping only one developer on the fixes or allocating 1-2 hours for bug fixes daily.

Why is Sanity Testing important?

The main purpose of Sanity testing is to provide a cursory check to the software before it can undergo the last different stages of testing, such as the alpha test and the beta test. You may ask why this kind of test should be conducted when there are different kinds of test that can be used to have an in-depth knowledge of the software’s capabilities. Well, the answer lies in the fact that it is not always necessary to run an in-depth analysis in the software’s functionality. So, running sanity testing, in this case, is not only practical, but it is also advantageous in the sense that there will be no bias that is present. The tester will solely try the software and then try to see if it induces the necessary output.

How is Sanity Testing done?

After the successful regression testing, which includes testing of the program that works and performs in the desired way, Sanity testing is performed. It is performed to check for the defects which may have surfaced previously and are fixed accordingly, and it ensures that there would be no further issue that will crop up again.

Read: Top 20 Frequently Asked Regression Testing Interview Questions & Answers

The ‘Hello world program’ is often used as a sanity test for a development environment. If Hello World program fails to compile the basic environment (or the compile process the user is attempting) has a configuration problem. If it works, then it can be said that the problem may be a bug in the specific application being compiled.

QA Quiz

Sanity testing can help you diagnose many of the problems that occur outside the environment. Sanity testing is very easy to perform. It is not complicated too. Just test it to check if it can produce the desired output. The user is required to have both a compiler and a computer to do this kind of quick sanity testing.

Another beneficial aspect of sanity testing is its use in the mathematical domain. You can use it to cross-check some calculations. For example, in multiplication, consider the numbers 918 and 155, if they are multiplied by each other, the product cannot be 142135, because the number 918 can be divisible by 3 and the number 142135 isn’t.

Advantages of Sanity Testing

  • Sanity testing helps in identifying defects quickly in the core functionality of the software
  • It can be carried out in lesser time as no documentation is required for sanity testing
  • If the defects are found during sanity testing, the project is rejected that helps save time for execution of regression tests

Disadvantages of Sanity Testing

  • The primary focus of Sanity testing is only on the commands and functions of the software
  • Sanity testing nowhere go to the design structure level, so it’s very difficult for the developers to understand as to how to fix the issues found during the sanity testing
  • In sanity testing, the testing is performed only for some limited features so if there is an issue in other functionalities then it will be difficult to catch them
  • Sanity testing is usually unscripted, so future references are not available

How is Sanity Testing related to Smoke Testing?

Software Sanity tests are commonly concreted with Smoke tests. A smoke test decides whether it is possible to continue testing, as opposed to whether it is reasonable. A software smoke test decides whether the program initiates or its interfaces are accessible and responsible (for example, the responsiveness of a web page or an input button). If the smoke test fails, it is impossible to escort a sanity test. In contrast, the ultimate sanity test employs the smallest subset of application functions that are required to determine whether the application logic is generally functional and correct (for example, the simple interest rate calculation for a financial application). If the sanity test fails, it is not reasonable to attempt more rigorous testing. Both sanity tests and smoke tests are ways to avoid wasting time and effort by quickly determining whether an application is too flawed to merit any rigorous testing. Many companies perform sanity tests on a weekly build as a part of their development process.

Let us now dive into key differences between Smoke Testing and Sanity Testing.

Read: What Is The Learning Path Of A Penetration Tester?
Smoke Testing Sanity Testing
It is a wide approach to testing where all parts of the application are tested. It is a small approach to testing where specific parts of the application are tested.
It measures the stability of the system by performing rigorous testing. It measures the rationality of the system by performing rigorous testing.
Smoke testing can be either manual or automated. Sanity testing can be performed without any test cases or scripts.
Smoke testing is also called a subset of acceptance testing. Sanity testing is also called a subset of regression testing.
Smoke testing may be stable or unstable. Sanity testing is stable.
Smoke testing is done to measures the stability of the system/product by performing testing. Sanity testing is done to measures the rationality of the system/product by performing testing.
Smoke testing is used to test all over the function of the system/product. Sanity testing is used in the case of only modified or defect functions of system/products.
Both testers and developers perform it. It is performed by only testers.
Testing is done without getting into deep, but whenever needed tester has to go into deep. Sanity testing does not need to go into deep of the application.
Smoke testing is documented. Sanity testing is not documented.
It is used to test the end to end function of the application. It is used to test only modified or defect fixed functions.

How can we adopt Sanity Testing?

Whenever the tester receives a software build with some minor issues in code or functionality, Sanity Testing carried. Then it is checked whether bugs reported in a previous build fixed or not. There can be a regression introduced due to these fixes. So, the main aim of this testing is to examine the working of planned functionality as per expectations. This method helps to execute Sanity testing instead of performing a whole process of regression testing.

Why this testing has to be adapted or conditions where this testing is required –

The big releases generally planned and executed in a proper and systematic format. But sometimes, small releases asked to be delivered as soon as possible. In such situations, software testing teams didn’t get much time to first document the test cases, then execute them, do the documentation for the bugs and finally do the regression and follow the whole long process.

QA Demo Class

In such expositions, here are some of the things a tester needs to keep in mind-

  • Perform Dev-QA Testing
  • Whatever bugs found, report these bugs
  • If there is a necessity to do Performance Testing or Stress testing or Load testing, you can have a proper automation framework. The process behind this is nearly impossible to test such things using a sanity test manually.
  • This a most important and last part of this testing strategy – While drafting the launch email or the document; mention it in the following way-
    • It should contain all the executed test cases
    • It should contain a report of bugs found with a status marker
    • If anything left untested mention those points with reasons

Final Words

With the above article, you might have understood how Sanity testing is important to stay in business and provide users the stability of the application. Remember, poor quality of software may result in lack of the adoption of the software, and this may result in the extreme losses (re-design, re-implementation, and re-testing) which may not be recovered easily. Thus, to get an effective performance of the software, Sanity testing is mandatory. Don’t you think the above reasons are enough to love Sanity testing? Did you find it useful to implement in your project? Tell us in the comment section below. Happy Testing!

Read: Jmeter Tutorial Guide for Beginners

    Janbask Training

    JanBask Training is a leading Global Online Training Provider through Live Sessions. The Live classes provide a blended approach of hands on experience along with theoretical knowledge which is driven by certified professionals.


Trending Courses

AWS

  • AWS & Fundamentals of Linux
  • Amazon Simple Storage Service
  • Elastic Compute Cloud
  • Databases Overview & Amazon Route 53

Upcoming Class

2 days 24 Nov 2019

DevOps

  • Intro to DevOps
  • GIT and Maven
  • Jenkins & Ansible
  • Docker and Cloud Computing

Upcoming Class

3 days 25 Nov 2019

Data Science

  • Data Science Introduction
  • Hadoop and Spark Overview
  • Python & Intro to R Programming
  • Machine Learning

Upcoming Class

3 days 25 Nov 2019

Hadoop

  • Architecture, HDFS & MapReduce
  • Unix Shell & Apache Pig Installation
  • HIVE Installation & User-Defined Functions
  • SQOOP & Hbase Installation

Upcoming Class

4 days 26 Nov 2019

Salesforce

  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL

Upcoming Class

12 days 04 Dec 2019

Course for testing

  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL

Upcoming Class

32 days 24 Dec 2019

QA

  • Introduction and Software Testing
  • Software Test Life Cycle
  • Automation Testing and API Testing
  • Selenium framework development using Testing

Upcoming Class

11 days 03 Dec 2019

Business Analyst

  • BA & Stakeholders Overview
  • BPMN, Requirement Elicitation
  • BA Tools & Design Documents
  • Enterprise Analysis, Agile & Scrum

Upcoming Class

3 days 25 Nov 2019

SQL Server

  • Introduction & Database Query
  • Programming, Indexes & System Functions
  • SSIS Package Development Procedures
  • SSRS Report Design

Upcoming Class

0 day 22 Nov 2019

Comments

Search Posts

Reset

Receive Latest Materials and Offers on QA Testing Course

Interviews