在生产系统中测试帐户和产品

时间:2022-03-17 15:28:34

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.

我已经在规范中实现了具有test =“True”属性的消息传递协议,并想知道现代模式是否应该包含用于标记订单,帐户,事务等的元数据作为像任何其他实体一样处理的测试实体 - - 但没有钱花钱的地步。也就是说:它伪造一个假想的信用卡并伪造一个包装的货物。

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?

预计这不会取代完全独立的测试,开发和QA数据库,但即使有这些,我们也始终在生产系统中拥有着名的测试SKU和测试客户。无害?

6 个解决方案

#1


3  

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.

在生产中使用测试帐户是我通常不赞成的,因为它打开了潜在的安全漏洞。人们应该努力尽可能多地复制测试中的生产环境,但显然有可能无法实现。仅昂贵的生产硬件就是一个很好的例子。我会说,作为一般惯例,它应该是气馁的,但是如果你能提供一个对你有意义的理由,那么你可能会忽略一个严格而快速的规则。

#2


2  

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".

我想最佳实践警察会说“永远不会在生产中进行测试”,甚至可能会说“开发人员不应该使用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.

但是,我在一个基于大型机的系统上工作,生产和测试/ qa / qc之间存在巨大差异;系统越大,这种情况就越可能发生。此外,与应用程序有关的组越多,这种情况就越可能发生。

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.

所以我的建议是,将测试帐户/产品投入生产是可以的,如果它有助于在上线后进行故障排除。

#3


1  

I wouldn’t put any test data in a production system nor would I want to have access to this system as a developer.

我不会在生产系统中放置任何测试数据,也不希望作为开发人员访问该系统。

I’m working in an industry with very sensitive medical and financial information and having such information would make it impossible to distinguish productive from data out of the testing system.

我在一个医疗和财务信息非常敏感的行业工作,而这些信息使得无法将生产与数据区分开来。

IMHO the best practice is to completely separate these two worlds and invest in setting up a procedure to prepare a comprehensive testing environment.

恕我直言,最佳做法是将这两个世界完全分开,并投资建立一个程序来准备一个全面的测试环境。

#4


1  

In out ERP systems (internally accessible only) we have test data so that when we move changes from test to production environments we can test the whole process. I view that data as a necessary evil, since subtle configuration differences between systems can cause catastrophic results, so once a change is in production we test is fully before "releasing" it to the users.

在ERP系统中(仅在内部可访问),我们有测试数据,因此当我们将更改从测试环境移动到生产环境时,我们可以测试整个过程。我认为数据是一种必要的恶魔,因为系统之间的微妙配置差异可能会导致灾难性的结果,因此一旦生产中发生变化,我们就会在将“释放”给用户之前完全进行测试。

As I said though, these are internal apps only, so the security risks are lessened somewhat - that's a very valid concern.

正如我所说,这些只是内部应用程序,所以安全风险有所减少 - 这是一个非常有效的问题。

#5


1  

Never ever test in prod, even though that is where all the revenue is generated/stats are collected/magic happens...?

从来没有测试过产品,即使这是产生所有收入/收集统计数据/魔术发生的地方......?

Always have a production test plan. There are going to be problems that happen on prod, or, if you are unlucky, only happens on prod. If you don't have anything in place, the first time you need to test on prod (which are usually high-stress cases) you'll be up the creek without a paddle.

始终有生产测试计划。生产中会出现问题,或者,如果你运气不好,只会发生在生产上。如果你没有任何东西,第一次你需要在prod(通常是高压力的情况下)进行测试,你将在没有桨的情况下上河。

It's not harmless to have test data on prod, you do need to be careful.

在prod上测试数据并不是无害的,你需要小心。

#6


1  

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.

在我的环境中,我们使用巡航控制来进行连续构建用于生成数据库的SQL脚本将使用其他所有内容检入CVS,并且每天从这些脚本重建数据库。

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.

我们的测试数据是第二组sql脚本,它们为测试数据库运行,不为生产数据库运行。

Given our environment test data never touches the production database.

鉴于我们的环境测试数据从未触及生产数据库。

This solution really works great for us.

这个解决方案真的对我们有用。

#1


3  

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.

在生产中使用测试帐户是我通常不赞成的,因为它打开了潜在的安全漏洞。人们应该努力尽可能多地复制测试中的生产环境,但显然有可能无法实现。仅昂贵的生产硬件就是一个很好的例子。我会说,作为一般惯例,它应该是气馁的,但是如果你能提供一个对你有意义的理由,那么你可能会忽略一个严格而快速的规则。

#2


2  

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".

我想最佳实践警察会说“永远不会在生产中进行测试”,甚至可能会说“开发人员不应该使用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.

但是,我在一个基于大型机的系统上工作,生产和测试/ qa / qc之间存在巨大差异;系统越大,这种情况就越可能发生。此外,与应用程序有关的组越多,这种情况就越可能发生。

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.

所以我的建议是,将测试帐户/产品投入生产是可以的,如果它有助于在上线后进行故障排除。

#3


1  

I wouldn’t put any test data in a production system nor would I want to have access to this system as a developer.

我不会在生产系统中放置任何测试数据,也不希望作为开发人员访问该系统。

I’m working in an industry with very sensitive medical and financial information and having such information would make it impossible to distinguish productive from data out of the testing system.

我在一个医疗和财务信息非常敏感的行业工作,而这些信息使得无法将生产与数据区分开来。

IMHO the best practice is to completely separate these two worlds and invest in setting up a procedure to prepare a comprehensive testing environment.

恕我直言,最佳做法是将这两个世界完全分开,并投资建立一个程序来准备一个全面的测试环境。

#4


1  

In out ERP systems (internally accessible only) we have test data so that when we move changes from test to production environments we can test the whole process. I view that data as a necessary evil, since subtle configuration differences between systems can cause catastrophic results, so once a change is in production we test is fully before "releasing" it to the users.

在ERP系统中(仅在内部可访问),我们有测试数据,因此当我们将更改从测试环境移动到生产环境时,我们可以测试整个过程。我认为数据是一种必要的恶魔,因为系统之间的微妙配置差异可能会导致灾难性的结果,因此一旦生产中发生变化,我们就会在将“释放”给用户之前完全进行测试。

As I said though, these are internal apps only, so the security risks are lessened somewhat - that's a very valid concern.

正如我所说,这些只是内部应用程序,所以安全风险有所减少 - 这是一个非常有效的问题。

#5


1  

Never ever test in prod, even though that is where all the revenue is generated/stats are collected/magic happens...?

从来没有测试过产品,即使这是产生所有收入/收集统计数据/魔术发生的地方......?

Always have a production test plan. There are going to be problems that happen on prod, or, if you are unlucky, only happens on prod. If you don't have anything in place, the first time you need to test on prod (which are usually high-stress cases) you'll be up the creek without a paddle.

始终有生产测试计划。生产中会出现问题,或者,如果你运气不好,只会发生在生产上。如果你没有任何东西,第一次你需要在prod(通常是高压力的情况下)进行测试,你将在没有桨的情况下上河。

It's not harmless to have test data on prod, you do need to be careful.

在prod上测试数据并不是无害的,你需要小心。

#6


1  

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.

在我的环境中,我们使用巡航控制来进行连续构建用于生成数据库的SQL脚本将使用其他所有内容检入CVS,并且每天从这些脚本重建数据库。

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.

我们的测试数据是第二组sql脚本,它们为测试数据库运行,不为生产数据库运行。

Given our environment test data never touches the production database.

鉴于我们的环境测试数据从未触及生产数据库。

This solution really works great for us.

这个解决方案真的对我们有用。