Open In App
Related Articles

Sandwich Testing – Software Testing

Like Article
Save Article
Report issue

Sandwich Testing combines the bottom-up and top-down approaches, so it uses the advantage of both the bottom-up and top-down approaches. Initially, it uses the stubs and drivers where stubs simulate the behavior of a missing component. It is also known as Hybrid Integration Testing.

Purpose of Sandwich Testing

  1. Entire Coverage: Sandwich testing tests a system’s high-level and low-level modules concurrently to give full coverage.
  2. Early Integration Problem Identification: It assists in identifying integration problems early in the testing process by testing from both ends and coming together in the middle.
  3. Incremental Testing: It is compatible with the incremental testing methodology, which integrates and tests components one at a time. A large software system’s complexity can be better managed with the help of this steady technique.
  4. Effective Use of Resources: Sandwich testing uses testing resources more effectively by testing components simultaneously.
  5. Component Interface Verification: The connections between high-level and low-level components are verified by sandwich testing.
  6. Testing and Development in Parallel: Testing and development can happen in parallel because of sandwich testing. High-level and low-level modules can be worked on by developers simultaneously and testing can start before all components are finished.

Prerequisite – Software Testing | Basics, Types of Software Testing


Sandwich Testing

Strategy used in Sandwich Testing

  1. It combines both top-down and bottom-up strategies. 
  2. Sandwich testing is basically viewed as 3 layers: 
    • Main target layer
    • A layer above the target layer
    • A layer below the target layer
  3. In sandwich testing, testing is mainly focused on main target layer. This testing is selected on the basis of system characteristics and structure code.  
  4. It tries to minimize the number of hubs and drivers when there are more than 3 layers. 

How to Perform Sandwich Testing? 

There are 3 simple steps to perform sandwich testing which are given below:

  1. Test the user interface in isolation using stubs.
  2. Test the very lowest-level functions by using drivers.
  3. When the complete system is integrated only main target (middle) layer remains for final test.

For Example: 

Advantages of Sandwich Testing

  1. Sandwich Testing approach is used in very large projects having subprojects.
  2. It allows parallel testing.
  3. It is a time-saving approach.
  4. It performs more coverage with same stubs.
  5. It can be used to test both the functional and non-functional aspects of a system.
  6. It can be used to test systems with complex dependencies.
  7. It can be used to test systems with complex data structures.
  8. It can be used to test systems with complex algorithms.
  9. It is an effective way to test both the functionality and the performance of an application.
  10. It is a well-defined process that can be easily repeated and documented.
  11. It can be used to test applications of all sizes and complexity.
  12. It is an efficient way to test applications that have a lot of functionality.

Disadvantages of Sandwich Testing

  1. Sandwich Testing can not be used for such systems which have a lot of interdependence between different modules.
  2. In sandwich testing the need for stubs and drivers is very high.
  3. It is expensive to set up and maintain the necessary infrastructure.
  4. here is a risk that the test environment may not be representative of the production environment, which could lead to inaccurate results.
  5. There is a potential for human error when manually transferring data between the two environments.

Last Updated : 03 Jan, 2024
Like Article
Save Article
Share your thoughts in the comments
Similar Reads