What is Sandwich Testing?
Blog post from testRigor
Sandwich testing, also known as hybrid integration testing, combines the top-down and bottom-up approaches to integration testing, allowing for early validation of both user-visible flows and core service behavior. It involves testing from the top layer with stubs to simulate missing lower components and from the bottom layer with drivers to exercise missing upper components. This method aims to meet at a stable middle layer where both testing streams converge. Sandwich testing provides early feedback on integration issues without waiting for the entire stack to be ready, thus reducing late-stage defect storms. It balances risk by exposing routing and orchestration issues from the top-down approach and data integrity and core rule defects from the bottom-up approach. While it requires careful coordination to prevent drift between stubs and drivers and to maintain clear contracts, it significantly improves early defect discovery and integration contract validation. Tools like testRigor can support this strategy by enabling resilient automation across UI and API layers, focusing on real integration outcomes rather than full end-to-end flows.