What Are You Missing in Your Testing Environment?

Bugs make their way to production. It’s a reality I’ve witnessed too often in my career. One of the common reasons for this is simply that testers miss them because the test environment doesn’t mimic the intended production environment. The bugs I remember most vividly were the most costly to the company - costs that could have been avoided with a small investment in the pre-production test environment, making it as close to production as possible. This is the story of one such bug.

A simple customer survey goes wrong

The marketing department at the retailer I worked for had an idea. The team wanted to get more information about their customers and decided to append a survey to customers’ receipts. As an incentive, those who filled out the survey were entered in a prize drawing. To collect the most shopper data, the department wanted these surveys to run during the holiday season when store traffic was at its zenith.

The requirements gathered called for the survey to present itself only on every twenty-fifth transaction at the point-of-sale (POS) terminal. The POS development team started to make the necessary code changes, unit testing was completed and the code sent to the QA department for more stringent testing. Test suites were created to test against all possible variables, not only for the designated twenty-fifth transaction when the survey should be presented, but all transactions leading up to it and beyond. There were a lot of variables in play.

The POS terminal was the company’s lifeblood; without it there was no revenue. It was imperative that any code changes, no matter how minor, did not disrupt that flow. Every transaction captured a mix of total dollar amounts and payment types. Customers had multiple payment options: cash, check, credit, gift cards, coupons, loyalty points, or a mix. As a result, tests needed to consider all of these variables, verify that transactions were correctly recorded and ensure they were sent to the other store systems that relied on POS data. This is where the problem started.

A small oversight leads to significant loss

While the POS systems in the test lab mimicked a store environment exactly, they didn’t mimic all the company systems that interacted with them. Testers ran scenarios and all transactions, regardless of type, were recorded correctly. Every twenty-fifth transaction added the survey to the printed receipt. All tests passed and we rolled out the change to all the production POS terminals in hundreds of stores.

The marketing department was pleased as the data started to roll in. Teams around the company considered the project a success... until about three weeks later when the accounting department found a large mismatch between actual and expected revenue. This was a big problem.

Teams investigated the root cause of the discrepancy. After some time and major effort, they discovered the issue: the code change that marketing had requested. Whenever the transactions that generated surveys were paid for via credit card, the POS terminal failed to send the data to the accounting department’s reconciliation system. A bigger problem was that the store systems only kept digital records of the transactions for 24 hours after the corporate systems confirmed receipt of the data.

Manual intervention wastes thousands of hours

Since our internal test environments did not mimic this scenario, instead of trying to fix the problem, we rolled back the code. While this solved the problem going forward, it did not recoup weeks of missing data for Accounting. The only records we had for reconciliation were the hundreds of rolls of printed POS transactions located in the back rooms of all our stores. Company leaders sent an urgent notice to all stores to gather these physical records and send them to the home office. Once they arrived, teams of accountants had to manually pore through every transaction from every store to find and restore the missing data in order to reconcile the books.

In the end, Marketing only received a fraction of the expected data and the company burned thousands of personnel hours to remedy the situation. All this for a single bug that might have been found if the company had made a small investment in the test environment.


Tackling Strategic Engineering Challenges

Engineering leaders from eBay and Walmart discuss how they tackle test automation, testing data, accessibility and other areas within their departments.

Watch now
Want to see more like this?
John Kotzian
Test Architect
Reading time: 5 min

Some Key Considerations for Testing Blockchain

Blockchain technology is changing the ways people think about — and process — secure transactions across different sectors. Transparency and testing are crucial in helping people trust the results. Explore some use cases and quality considerations.

Generative AI Use Is Growing – Along With Concerns About Bias

See the results of Applause’s survey on generative AI use and user sentiment

How to Land Your Dream Software Testing Job

Here’s how to stand out in a competitive yet thriving QA job market

What Is Continuous Testing in DevOps?

Learn about continuous testing benefits, tools and frameworks

Digital Quality as a Service: A Necessary Evolution of Software Testing

Read how Digital Quality as a Service (DQaas) can help organisations to deliver the very best digital experiences.

Creating Seamless B2B Software Experiences for All Users

B2B software companies must ensure they cater to multiple audiences, often with varied needs, to stay ahead in a competitive market.