Sanity Testing | Software Testing - GeeksforGeeks (2024)

  • Read
  • Discuss

    Introduction:

    Sanity testing is a type of software testing that aims to quickly evaluate whether the basic functionality of a new software build is working correctly or not. It is usually performed on builds that are in the initial stages of development, before the full regression testing is performed. Sanity testing is limited in scope and typically focuses on critical functionality and does not aim to uncover every possible error or bug in the system. It is a quick and lightweight way to ensure that the software is functioning as expected before further testing is conducted.

    Sanity Testing is a subset of regression testing. Sanity testing is performed to ensure that the code changes that are made are working as properly. Sanity testing is a stoppage to check whether testing for the build can proceed or not. The focus of the team during sanity testing process is to validate the functionality of the application and not detailed testing. Sanity testing is generally performed on build where the production deployment is required immediately like a critical bug fix.

    Functionality of Sanity Testing:

    The functionality of sanity testing is to verify that the critical functionality of a software build is working correctly, without performing a comprehensive analysis of the entire system. Sanity testing typically involves testing the most important and frequently used features of the software to ensure that they are functioning as expected. The purpose of sanity testing is to quickly identify any major issues that would prevent the software from being used, rather than to uncover every possible error or bug in the system. Sanity testing may also include verifying the user interface, data input and output, and other key elements of the software. The scope of sanity testing is limited, and it is typically performed on builds that are in the early stages of development before full regression testing is conducted.
    The major functionality of sanity testing is to determine that the changes or the proposed functionality are working as expected. If the sanity test fails, software product is rejected by the testing team to save time and money. It is performed only after the software product has passed the smoke test and Quality Assurance team has accepted for further testing.

    Example of Sanity Testing:
    In an e-commerce project, main modules are login page, home page, user profile page, user registration etc. There is a defect in the login page when the password field accepts less than four alpha numeric 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, login page is validated as well as the profile page to ensure that the checks are working fine at both the places.

    Features of Sanity Testing:

    1. 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 narrow and deep approach of testing where limited functionalities are covered deeply.
    5. Performed by testers:
      Sanity testing is normally performed by testers.

    Advantages of Sanity Testing:

    • Sanity testing helps in quickly identify defects in the core functionality.
    • It can be carried out in lesser time as no documentation is required for sanity testing.
    • If the defects are found during sanity testing, project is rejected that is helpful in saving time for execution of regression tests.
    • This testing technique is not so expensive when compared to another types of testing.
    • It helps to identify the dependent missing objects.
    • It is used to verify a small functionality of the system application whether it is still working or not even after a small change.
    • It helps in the scenario when the time for testing of the product is limited or having less time to complete the test.
    • Quick Feedback: Sanity testing is a fast process that provides quick feedback on the overall functionality of a software build, allowing teams to quickly identify and address any critical issues.
    • Cost-effective: Sanity testing is less time-consuming and less expensive than other types of testing, making it a cost-effective solution for evaluating new builds.
    • Early Detection of Issues: Sanity testing helps to identify major issues early in the development cycle, which can help to avoid costly rework later on.
    • Increased Confidence: Sanity testing helps to increase confidence in the quality of the software, by ensuring that the most critical functions are working as expected before more comprehensive testing is performed.
    • Improved Productivity: Sanity testing enables developers and testers to focus on more complex testing scenarios, improving overall productivity and reducing the time required for full regression testing.

    Disadvantages of Sanity Testing:

    • It focuses only on the functions and commands of the system application.
    • It is not possible to cover all the test cases in test scenarios.
    • It covers only few functionalities in the system application. Issues in the unchecked functionalities can’t be recovered.
    • Sanity testing is usually unscripted. Hence, future references are not available.
    • It doesn’t cover the design structure level and hence it will be difficult for development team to identify and fix the issues.
    • Limited Scope: The limited scope of sanity testing means that it may not uncover all potential issues or bugs in the software. This means that more comprehensive testing will be required to thoroughly validate the software’s functionality.
    • Incomplete Testing: Sanity testing is only a preliminary evaluation of the software, and it does not provide a complete picture of the software’s performance or quality.
    • Potential for False Positives: Sanity testing is a quick process that may produce false positives, indicating that a particular feature or function is working correctly when it is actually broken.
    • Dependence on Expertise: The success of sanity testing depends on the expertise and knowledge of the tester, who must have a deep understanding of the software’s critical functions in order to perform the tests effectively.
    • Time Constraints: While sanity testing is faster than other forms of testing, it can still be time-consuming and may require a significant amount of time and resources to complete. This can be a disadvantage when time is a critical factor in the development process.

    Last Updated :06 Feb, 2023

    Like Article

    Save Article

    Sanity Testing | Software Testing - GeeksforGeeks (2024)

    FAQs

    Sanity Testing | Software Testing - GeeksforGeeks? ›

    Sanity testing is a type of software testing that aims to quickly evaluate whether the basic functionality of a new software build is working correctly or not. It is usually performed on builds that are in the initial stages of development, before the full regression testing is performed.

    What is a sanity test in software testing? ›

    Sanity testing is a type of software testing that aims to quickly evaluate whether the basic functionality of a new software build is working correctly or not. It is usually performed on builds that are in the initial stages of development, before the full regression testing is performed.

    What is the difference between smoke and sanity testing in software testing? ›

    Smoke testing is done to assure that the acute functionalities of program is working fine. Sanity testing is done to check the bugs have been fixed after the build. Smoke testing is also called subset of acceptance testing. Sanity testing is also called subset of regression testing.

    What is sanity testing with simple example? ›

    Here, we do a sanity test of the application. Non-technical example: Suppose you are developing a mobile application and encounter a payment checkout error. The testing team reported this error to the developing team to resolve it quickly. The development team fixed the error and sent it to the testing team for a fix.

    Who will perform sanity testing? ›

    Smoke Testing is done by both the dev team or by the QA team and can be taken as a subset of rigorous testing. Whereas both Sanity & Regression testing are done only by the QA team. Also, Sanity testing can be considered as a subset of acceptance testing.

    Is sanity testing white box testing? ›

    Sanity testing is a more in-depth type of white box testing used to verify a system's basic functionality after major changes, such as code refactoring or updates to the database.

    Is sanity testing a test type or test level? ›

    What is Sanity Testing. Definition: Sanity testing is a subset of regression testing. After receiving the software build, sanity testing is performed to ensure that the code changes introduced are working as expected . This testing is a checkpoint to determine if testing for the build can proceed or not.

    Is sanity testing done by developer or tester? ›

    Key Differences Between Sanity Testing vs Smoke Testing
    Smoke testingSanity testing
    Can be carried out by both testers and developersCarried out by testers
    A subset of acceptance testingA subset of regression testing
    Done when there is a new buildDone after several changes have been made to the previous build
    3 more rows

    Why sanity testing is called sanity testing? ›

    Sanity Testing or Surface Level testing is a type of testing which is performed on the stable build of the software. It is a quick and basic test (or set of tests) to ensure that the code changes made are working properly without any bugs.

    What is difference between sanity and regression testing? ›

    Sanity Testing is performed to check the stability of new functionality or code changes in the existing build. Regression testing is performed to check the stability of all areas impacted by any functionality change or code change. 02. Sanity Testing is part of Regression Testing.

    What is another name for sanity testing? ›

    It is performed to check whether the bugs have been fixed after the build. Generally, Sanity testing is performed on stable builds. It is also known as a variant of regression testing.

    What is sanity testing in UAT? ›

    Sanity test is usually unscripted, helps to identify the dependent missing functionalities. It is used to determine if the section of the application is still working after a minor change. Sanity testing can be narrow and deep. Sanity test is a narrow regression test that focuses on one or a few areas of functionality.

    What testing is done after sanity testing? ›

    Regression testing is carried out after running sanity tests of any changed functionality, leading to Quality Assurance and related functionalities. It is only done by the QA team.

    What is sanity checklist? ›

    A sanity checklist or sanity testing is a type of software testing performed by testers to ensure that new builds of software work properly. This quick process prevents the developer and her QA team from wasting time and resources on more rigorous testing of software builds that aren't ready yet.

    Do we write test cases for sanity testing? ›

    same as smoke testing, we don't write test cases particularly to do sanity testing. Functional Testing: We do test each and every feature of the software application to make sure whether each feature is behaving as specified in the requirement document. To do functional testing, we do write test cases.

    Is sanity testing automated? ›

    Sanity tests are more often scripted and automated because they are derived from existing Regression tests. Automating Sanity tests can save time and provide faster results for the development team to take action on.

    What is sanity testing in agile methodology? ›

    The purpose of sanity testing is to verify that the software is still usable and meets the essential requirements after a minor change. It is not meant to be a comprehensive or in-depth testing, but rather a confirmation that the change did not introduce any major defects or break any critical features.

    Is sanity testing functional testing? ›

    Several testing types are considered functional testing like smoke testing, sanity testing, regression testing, and more. On the other hand, non-functional testing objectives are to examine numerous elements such as performance, security, usability, and more.

    Top Articles
    Latest Posts
    Article information

    Author: Msgr. Benton Quitzon

    Last Updated:

    Views: 6572

    Rating: 4.2 / 5 (63 voted)

    Reviews: 86% of readers found this page helpful

    Author information

    Name: Msgr. Benton Quitzon

    Birthday: 2001-08-13

    Address: 96487 Kris Cliff, Teresiafurt, WI 95201

    Phone: +9418513585781

    Job: Senior Designer

    Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

    Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.