Turn your manual testers into automation experts! Request a DemoStart testRigor Free

Testing in Production: What’s the Best Approach?

When it comes to software testing, the more is usually the better. That is why many companies are now employing continuous testing practices to ensure they provide the highest quality product to their users. Today we are going to talk about one of the stages – testing in production, the actual live environment after the release. We will cover the main challenges and considerations so that you can develop the best strategy for your company and your software project.

At the beginning of a new iteration, lower testing environments are typically used for verifying changes during the development process. Next is the staging environment, meant to be as close to production as possible – which helps to eliminate most potential issues. However, getting an exact 100% match of the production environment is an almost impossible task. Even if we achieve this exact parity, some issues might still get introduced during deployment to production.

After all, no one cares if any of the lower environments were bug-free. What matters is that the actual production environment is bug-free, therefore testing has to be done during this stage as well.

Some people might think testing in production is a sign of lower testing quality since they believe it is a concept of deploying poorly tested applications to the end-user. However, this is not the right way to employ this technique. If we test in a production environment, it is not because it was poorly tested during the previous stages. Rather, it is the last defense shield against any real-time bugs. Another reason we might need to test in production is that some types of testing simply have to be done with the real users.

Benefits of

Testing in Production

  • It can help us create a disaster rescue process making our application more resilient toward unanticipated collapses.
  • Performing testing in production offers an advantage of access to production data which could be hard to reproduce in lower testing environments.
  • Regular monitoring of an application in production reduces deployment risks.
  • It can help in gathering valuable user feedback through releasing beta programs.

What Testing to Perform in Production

There are a handful of techniques that can be used – let’s now unravel the main ones we can leverage.

Regression testing

The first thing we want to do after each software release is to make sure that:
  • No new bugs were introduced during the deployment (especially if the deployment process is not fully automated)
  • The newly released code has smoothly integrated with the previously existing code. This is especially critical if the staging environment or at least one of its related microservices isn’t an exact copy of the production environment.

Depending on how the deployment is set up within the company, regression testing in production might be a much shorter version of the full regression test suite. Some companies also have certain policies around testing on live user data, which might also limit the possible test scenarios.

To sum it up, you ought to run as many regression tests in production as necessary to provide you with the peace of mind that the release went smoothly and no new bugs were introduced during the release.

A/B Testing

One of the testing mechanisms that can only be run on the live environment is A/B testing, which means releasing two (or more) different versions of an application/software to predict if real users prefer one over the other. It is a statistical activity where we split the user base into multiple groups, namely A and B. Then present a base version to group A users and a slightly modified version to group B users. Finally, we can compare both sets of user groups to predict the application behavior to make an informed decision on which version to roll out for future releases.

As you might have guessed, A/B testing cannot be performed outside the production environment, but when done with real users effectively, it can provide valuable user feedback for all application stakeholders.

Canary Releases

Canary release or beta programs are another types of mechanism used in production testing. It differs from A/B testing releases in a way that a canary release is intended only for a small subset of users to test the application and closely monitor for any bugs/defects.

It can be treated as a risk mitigation technique, rather than acquiring the interest of users in the feature as done in A/B testing.

Volume Testing

Although high user volume can be simulated in a lower environment, it is still a good idea to perform volume testing in a production environment to get the most accurate results. It provides statistics for any kind of website load, the responsiveness of web pages, and server performance while servicing client requests.

Continuous Monitoring

Continuous monitoring comes as another set of testing strategies in production which can help identify issues that could only come in prod.

Furthermore, there are two sub-categories in it – real user monitoring and simulation monitoring.

Real user monitoring closely looks at real user requests coming to the application server, whereas simulation monitoring is setting up automated users who will continuously make requests to the application’s APIs to check response time and failures.

Due to the widespread use of software engineering and QA best practices, we can now afford to test in production safely.

Risks Involved

Depending on the type of tests, testing in production can bear some risks which you should account for in advance. Such risks involve:
  • Loss of data.
  • Relying on the user to provide feedback for defects.
  • Having test data mixed with the production data.

System crashes and negative user experiences top the list of risks involved as they can set a bad perception for a company and their product leading to financial losses. There is always a right way and a wrong way to employ the new approaches, thus “Better safe than sorry” is perfectly applicable here.

Best Practices – What to Employ or What not to?

Now, let us ponder over some best practices or approaches to follow while doing testing in production, which could save us from the above risks involved.

Stress Testing

Since production testing intends to identify bugs in the real world, it needs to occur in the most challenging real-world conditions. So, stress testing the application with high traffic is a way to determine how app functions behave when the load suddenly increases with greater incoming requests. That way, we can ensure to follow some error recovery processes in such extreme conditions.

Forced Failure Testing

Deploy a Chaos Monkey to introduce frequent random failures like a system crash to make recovery mechanisms even stronger. An analogy for this might be forcing someone (or something) to face hardships or harsh environments to achieve a saturation or immunity to such bad effects.

Timely Monitoring

Choose your sanity or regression tests to be run during business hours instead of non-working hours with proper close monitoring of key performance indicators.

Finally, we can say production testing helps create a better user experience with a better risk mitigation structure in place, leading to proper business revenue. Nowadays, as a part of the software testing life cycle (STLC), it is quite easy to do production testing with proper DevOps infrastructure with continuous integration and deployment.

How testRigor Can Help

If you’ve been following us for some time, you might already know that testRigor is the optimal solution for automated end-to-end UI testing across web, desktop, and mobile platforms – all with the convenience of plain English commands. We’ve also just recently rolled out the load testing feature, which helps companies to be certain their infrastructure can withstand the higher load.

And if you don’t have a testRigor account yet – you can now register one for free and explore the possibilities on how to strengthen your automated testing.