In this series, we discussed the landscape for the testing of new API initiatives that have dependencies on one or more back office services and the issues raised. In this article, we discuss how sandbox simulations can “shift left” the testing of any new or existing API initiatives whilst also enabling them to fully participate in Agile and CI/CD processes.
Returning to the original view we provided of a REST service with dependencies on one or more existing services looks something like this:
In order to enhance the ability to prototype, develop and test this new service, a sandbox is created for each dependent service. Unlike the above example, it’s likely to be a case of one or two services. What this provides is:
- A functional version of the dependent services is created.
- A set of functional data is created in support of those services.
- The sandbox can then be started in the Cloud or on premise.
- The sandbox can be started and shared. In a development and testing environment a sandbox can be started for each developer to avoid the issues inherent in sharing test environments and data.
This would then look like the following:
This then enables the following changes to the SDLC:
The advantages that this offers:
- Testing ‘shifts left’ as a fully functional, simulation environment can be available from the prototyping phase.
- A fully functional, continuous integration and testing environment can be created using the sandboxes.
- Sandboxes can be used to augment existing systems for testing when the sandboxed system is not available.
- This ultimately takes pressure off the real test systems as given a quality sandbox environment, the final test against the real system should simply be a validation to go through the gate to the next phase of the release cycle.
- Once a sandbox simulation is created for one project, it can be reused again and again in future projects.
This ultimately will result in the following:
- Better quality deliverables.
- An ability to deliver faster and more consistently.
- An ability to ‘fail fast’ at the prototyping phase as prototypes are far more realistic and can thus prove the value (or not) of any proposed set of APIs.
- Enhanced testing of unhappy error paths in the code.
- Increased productivity from your teams as bugs are found earlier in the SDLC.
- Reduced costs as pressure is reduced on your expensive legacy systems.
Ultimately sandbox simulations can enhance any new or existing API projects.