生产运行code /服务器上测试 [英] Running test on Production Code/Server

查看:247
本文介绍了生产运行code /服务器上测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是相对缺乏经验,当涉及到单元测试/自动化测试,所以原谅的问题,如果它没有任何意义。

I'm relatively inexperienced when it comes to Unit Testing/Automated Testing, so pardon the question if it doesn't make any sense.

目前的code碱基我的工作是如此紧密耦合的,我会永远需要能够在其上运行单元测试之前,重构大部分code,所以我读了一些职位,发现硒,我认为这是一个非常酷的程序。

The current code base I'm working on is so tightly coupled that I'll need to refactor most of the code before ever being able to run unit tests on it, so I read some posts and discovered Selenium, which I think is a really cool program.

我的客户想具体的自动化测试来运行我们的生产服务器上每隔十分钟,以确保我们的网站是可操作的,而某些功能/方面运行正常。

My client would like specific automated tests to run every ten minutes on our production server to ensure that our site is operational, and that certain features/aspects are running normally.

我从来没有真正想过运行测试,对生产服务器,因为您要添加附加应力的网站。我一直以为你会跑反对临时服务器所有的测试,如果这些工作,你可以假设prouction网站只要托管服务提供商不会遇到的问题是可操作的。

I've never really thought to run tests against a production server because you're adding additional stress to the site. I always thought you would run all tests against a staging server, and if those work, you can just assume the prouction site is operational as long as the hosting provider doesn't experience an issue.

在实际的生产服务器上测试生产code你到底有什么想法?

Any thoughts on your end on testing production code on the actual production server?

非常感谢你们!

推荐答案

也许如果你认为硒脚本作为监督而不是测试的,这将有助于?我希望每一个主要网站在那里有某种监控的事情,哪怕它只是一个周期性的PING,或每隔一段时间加载网页。虽然可以采取这种方式太远,不要怕一般的概念。所以,什么才是一些这方面的监测/检测的好处给你和你的客户?

Maybe it would help if you thought of the selenium scripts as "monitoring" instead of "testing"? I would hope that every major web site out there has some kind of monitoring going on, even if it's just a periodic PING, or loading the homepage every so often. While it is possible to take this way too far, don't be afraid of the concept in general. So what might some of the benefits of this monitoring/testing to you and your client?


  1. 不知怎的,不是所有在世界上最好的测试可以predict的奇怪的事情的用户会做,无论是有意还是用数字的纯粹力量(如果在打字机百万只猴子可以写哈姆雷特,试想哪几个百点击快乐的用户可以做什么?ping一台网站可以告诉你,如果这回事,但如果一个表已损坏,报告现在失败,都是因为与它一个变音符号的值类型的用户。

  1. Somehow not all the best testing in the world can predict the odd things users will do, either intentionally or by sheer force of numbers (if 1 million monkeys on typewriters can write Hamlet, imagine what a few hundred click happy users can do? Pinging a site can tell you if it's up, but not if a table is corrupted and a report is now failing, all because a user typed in a value with a umlaut in it.

当你的网站可能会执行临时服务器上的伟大,也许它会开始随着时间的推移。如果要监视的硒测试的性能,可以保持领先缓慢的抱怨。正如你所说的当然是确保你的监控不会造成任何的问题!您可能需要说服你的客户,某些测试适合于每X分钟运行,其他的只需要每天一次跑,在凌晨3点。

While your site might perform great on the staging servers, maybe it will start to degrade over time. If you are monitoring the performance of those selenium tests, you can stay ahead of slowness complaints. Of course as you mentioned, be sure your monitoring isn't causing problems either! You may have to convince your client that certain test are appropriate to run every X minutes, and others should only be run once a day, at 3am.

如果你最终做出紧急更改到直播现场,你会更放心,测试运行,以确保一切正常。

If you end up making an emergency change to the live site, you'll be more confident knowing that tests are running to make sure everything is ok.

这篇关于生产运行code /服务器上测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆