What is Shadow Testing?

Hardik kumar
3 min readAug 27, 2022

--

The term “Shadow Testing” has become necessary for tech companies nowadays as they have to keep their customers their priority. They don’t risk testing their latest features on their customers and then modifying them accordingly, instead, they test their new features on a small group of users to test that feature beforehand.

Shadow Testing, also known as Dark Launching, is a process that allows us to test our production-ready software to a small group of users while the actual users still using the same product without the new feature.

Illustration of Dark Launch

Shadow testing is used to monitor the differences between the current environment and the new environment with a new feature. This is done to reduce any risks before its actual release to the users.

We get an insight into the behavior of actual users by sampling real traffic without affecting the code and the users in the production environment.

What Shadow Testing does is that it creates a similar environment as the production environment (V-Current) to duplicate the actual user traffic which we can also call a shadow of the production environment. The new feature is now being tested in the (V-Next) environment. Once the testing is done, the responses of the two environments are compared to reduce any risks before sending the new feature to the production environment.

Let’s understand this with an example of API testing…

There are some tools to implement Shadow Testing like Keploy, Diffy, etc. These tools' primary purpose is to compare V-Current and V-Next responses and then find the differences.

We’ll talk about Keploy here. Let’s say you own Amazon and there’s an API to fetch a product’s reviews. Now, you’ve added a new feature to Amazon that shows the verified or popular users’ reviews at the top. Once you finish testing the feature, you have to test your APIs also to check if they are working as expected or not. Here, Keploy comes in to test the expected behavior of all the APIs.

Keploy already knows the expected behavior of the APIs that have been tested previously, this time it will automatically test the APIs and compare the difference between their responses to check if they are still showing the expected output.

To sum up, Shadow testing does

  1. Zero impact on the production environment
  2. No need to generate test cases and test data
  3. We can test real-life scenarios with real-life data
  4. We can stimulate scale with replicated production traffic

--

--