Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Test accounts and products in a production system

Is it worth designing a system to expect test accounts and products to be present and active in production, or should there be no contamination of production databases with test entities, even if your shipping crew knows not to ship any box addressed to "Test Customer"?

I've implemented messaging protocols that have a test="True" attribute in the spec, and wondered if a modern schema should include metadata for tagging orders, accounts, transactions, etc. as test entities that get processed just like any other entity--but just short of the point where money gets spent. Ie: it fakes charging an imaginary credit card and fakes the shipment of a package.

This isn't expected to be a substitute for a fully separated testing, development, and QA database, but even with those, we've always had the well-known Test SKU and Test Customer in the production system. Harmless?

like image 944
Chris Wenham Avatar asked Sep 23 '08 14:09

Chris Wenham


People also ask

How do you test a production system?

Production testing and feature flagsRunning tests in production via rollouts or feature flags allows for all the product data, dependencies and edge cases to be accounted for in comprehensive integration tests. Having real-world data can be especially powerful when doing performance testing or load testing.

What type of testing is done in production?

Performance testing is a common production testing process designed to test the speed, stability, response time, scalability, and reliability of a software application or a website. A specific amount of load is applied to the website in order to gauge its performance.

What are test accounts?

The test account is how IT can verify functionality. Because of the application requirements, most test accounts have full administrative privileges meaning that the account has access to every capability in the given application.

Should tests be run in production?

You should at least run the same set of tests on your application before it reaches production, on a staging or testing environment. This will make sure that your tests won't break anything on production, but it will also catch any major bug before your customers do.


3 Answers

Having testing accounts in production is something I usually frown upon because it opens up a potential security hole. One should strive to duplicate as much of the production environment in testing as possible but there are obviously cases where that isn't possible. Expensive production only hardware is a prime example. I would say as a general practice it should be discouraged but as with all things if you can provide a reason which makes sense to you then you might overlook a hard and fast rule.

like image 168
stimms Avatar answered Oct 10 '22 01:10

stimms


I imagine the Best Practice Police would state the mantra "never ever test in prod" and maybe even throw in "developers should not have access to prod".

However, I work on a mainframe-based system where there are huge differences between production and test/qa/qc; the larger the system, the more likely such a situation is. Additionally, the more groups that have a stake in the application, the more likely this is.

I need more than two hands to count how many times we could only duplicate a problem in the production environment. The option then becomes creating test tables/users/data or using live customer data.

At times we do also create test records in production tables, as some users/clients like having something they can search/retrieve that is always there.

So my advice is that it is OK to put test accounts/products into production if it will help to troubleshoot after go-live.

like image 3
tomasso Avatar answered Oct 10 '22 02:10

tomasso


If your database is created from scripts in an automated fashion, then this becomes a non-question.

In my environment we use cruise control for continuous builds. The SQL Scripts for generating the database are checked into CVS with everything else, and the database is rebuilt from those scripts on a daily basis.

Our test data is a second set of sql scripts, which are run for the test database and are not run for the production database.

Given our environment test data never touches the production database.

This solution really works great for us.

like image 2
KyleLanser Avatar answered Oct 10 '22 02:10

KyleLanser