What is Sandwich Testing (Definition, Types, Examples)?

Automation TestingSoftware TestingTesting Tools

Integration testing is a specific phase in software testing where testers combine and test all standalone modules into one entity. In this phase, testers test each module of the interface and communication. These tests are conducted using two approaches- top-down and bottom-up integration testing. Sandwich Testing, aka Hybrid integration testing, comprises both the bottom-up and top-down testing approach. In short, in sandwich testing, testers gain the advantages of both of these approaches, making the process more precise and result-oriented.

Features of Sandwich Testing

Below are the features of sandwich or hybrid testing −

  • It comes with three layers − the main target layer, the layer below the target layer, and a layer above the target layer.

  • The testing is primarily focused on the middle target layer.

  • It is selected as per the characteristics of the code structure.

  • Testers can adopt sandwich testing to work with the working version of a software application.

  • It is also used to determine the develop the basic working system at the earliest stage of the software development cycle.

The main objective behind sandwich testing is to eliminate weaknesses and improve the quality of a product by introducing evolved methodologies. Testers used advanced techniques like dynamic symbolic execution and search-based techniques to generate quality test data covering all branch statements. This promotes code coverage accuracy at regular intervals of time by minimizing test cases.

Why is sandwich testing necessary in software testing?

Lack of proper methodology can lead to project failure. Each software comes with a specific methodology, with each methodology having its characteristics. The hybrid or sandwich testing comprises different technologies, ensuring maximum coverage of methodologies required for a successful testing process.

Example of Sandwich Testing

Sandwich testing is similar to web application testing.

For instance, an application of windows includes an amalgamation of user interfaces like .NET, MFC, and WPF. One can install such hybrid apps on their system. Not only are they free from compatible issues, but they also take less time for installation and execution. They offer consistency and full cross-platform compatibility with major devices. Developers can write a single script and run it on multiple platforms at ease.

Testing involved in Hybrid application program

Testing involved in Hybrid application program There are three types of testing conducted in a hybrid application program

  • Function Testing − It is conducted to ensure that all features in the program are working perfectly. It ensures that the app can easily use the built-in resources.

  • Connecting Testing − It ensures that the application can work accurately with multiple types of network connections. Besides, it also verifies that users can switch different connection types and work without any network connection.

  • Compatibility testing − It makes sure the app runs on different devices without showing any compatibility issues.

Before we learn more about the Sandwich approach, let's have a brief idea about integration testing.

Integration Testing

Software engineers use a varied range of strategies to execute integration testing, featuring −

  • Big bang approach

  • Incremental approach: It is divided into three stages- Top-Down, Bottom-up, and sandwich (combination of top-down and bottom-up) approach

Big-Bang Testing

Big bang testing is great for small systems. In this testing, all components or modules are combined (aka entity) at once and tested as a unit.

Incremental Testing

In incremental testing, at least two or more modules (logically related) are integrated and tested. Then the testers gradually add the other related modules until all related modules are integrated and tested successfully.

Incremental testing is conducted using two methods: Bottom-up and top-down testing.

Bottom-up Integration Testing

In this approach, the testers test the lower-level modules first. All the modules tested are later used to test higher-level modules. The process continues until all top-level modules are tested completely.

Advantages

  • Easy for fault localization

  • Unlike the big bang approach, one doesn't have to develop all modules to start the testing process.

Limitation

  • Since critical modules are tested last, it may lead to defects

  • Cannot test early prototypes

Top-down Integration Testing

The testing is conducted from top to bottom through the software system control flow in the top-down integration approach. Contrary to the bottom-up approach, testers test the higher-level modules first, following the lower-level modules. If some modules are not ready, test engineers can use stubs as an alternative.

Advantages

  • Easy to fault localization

  • Getting an early prototype is easier

  • Since critical modules are tested first, it would be easier to detect major flaws at the earliest.

Limitations

  • Lower modules are often getting neglected

  • Needs many stubs

Sandwich Testing

As discussed earlier, sandwich testing is a hybrid of the bottom-up and top-down approaches. Meaning, both top-level modules and lower-level modules are integrated and tested together as a system. Therefore, sandwich testing is also known as hybrid integration testing. This testing requires the use of both stubs and drivers.

How to run a sandwich testing?

The sandwich testing process can be divided into five steps:

  • Step 1 − Prepare the test plan

  • Step 2 − Develop the test scenarios, cases, and scripts

  • Step 3 − Run the test cases and report the defects

  • Step 4 − Track the defects and test them again

  • Step 5 − Repeat steps 3 and 4 until the integration is completed successfully

Attributes of Sandwich Testing

  • Decide the methods or approaches to be used in the testing process

  • Allocate scopes and out of scope items

  • Assign roles and responsibilities

  • Accommodate prerequisites for the testing

  • Prepare the testing environment

  • Prepare risk and mitigation plans

Entry and Exit Criteria of Integration Testing

Below are the entry and exit criteria to conduct an integration testing

Entry Criteria

  • Prepare all unit tested components or modules

  • Fix and close all highly critical bugs

  • Complete the code of all modules and integrate them successfully

  • Sign off and document all integration test plans, test cases, and scenarios

  • Set up the required test environment

Exit Criteria

  • Test all integration application

  • Document all executed test cases

  • Fix and close all highly prioritized bugs

  • Submit all technical documents along with release notes

Before running a sandwich testing, it's crucial to study the architecture design of the application. This helps you identify the critical modules better. Testers can contact the architectural team to obtain the interface design to create and verify test cases and interface details.

raja
Published on 13-Jul-2021 10:41:44
Advertisements