有没有一种情况:程序有bug,代码却是正确的?
作者:网络转载 发布时间:[ 2013/1/14 10:06:53 ] 推荐标签:
在正常的计算机中,这样的压力测试不会出问题,但有大约1%运行GW的计算机会出问题!1%听起来不是个很大的数字,但当有100万玩家时,意味着每天会有至少1万个崩溃bug,这样编程团队将需要几周来研究这的bug!
压力测试失败时,GW会关闭游戏并打开一个“硬件问题”的网页,以此提示用户哪些常见的原因会导致这样的错误:
Memory failure: in the early days of the IBM PC, when hardware failures were more common, computers used to have “RAM parity bits” so that in the event a portion of the memory failed the computer hardware would be able to detect the problem and halt computation, but parity RAM fell out of favor in the early ’90s. Some computers use “Error Correcting Code” (ECC) memory, but because of the additional cost it is more commonly found on servers rather than desktop computers. Related articles: Google: Computer memory flakier than expected and doctoral student unravels ‘tin whisker’ mystery.
Overclocking: while less common these days, many gamers used to buy lower clock rate — and hence less expensive — CPUs for their computers, and would then increase the clock frequency to improve performance. Overclocking a CPU from 1.8 GHz to 1.9 GHz might work for one particular chip but not another. I’ve overclocked computers myself without experiencing an increase in crash-rate, but some users ratchet up the clock frequency so high as to cause spectacular crashes as the signals bouncing around inside the CPU don’t show up at the right time or place.
Inadequate power supply: many gamers purchase new computers every few years, but purchase new graphics cards more frequently. Graphics cards are an inexpensive system upgrade which generate remarkable improvements in game graphics quality. During the era when Guild Wars was released many of these newer graphics cards had substantially higher power needs than their predecessors, and in some cases a computer power supply was unable to provide enough power when the computer was “under load”, as happens when playing games.
Overheating: Computers don’t much like to be hot and malfunction more frequently in those conditions, which is why computer datacenters are usually cooled to 68-72F (20-22C). Computer games try to maximize video frame-rate to create better visual fidelity; that increase in frame-rate can cause computer temperatures to spike beyond the tolerable range, causing game crashes.
在大学期间,我的Mac上有个扩展硬盘,经常会在春夏因为温度过高而出故障。因此我买了一个4英尺长的SCSI电缆,足够从我的计算机连到冰箱(我叫它Julio)了,并且全年将它存放在冰箱里,后来再也没出过问题!
于是每当GW支持团队收到过热问题的反馈,都会鼓励玩家去改善空气流动、增加散热风扇,或者清理一下计算机中的灰尘,这些做法通常都很奏效。
这个计算机压力测试不仅完成了它的使命,还获得了丰厚的回报:我们能够识别电脑产生虚假的bug报告并且忽视这些崩溃。一周内有数百万玩家在玩我们的游戏,即使很低的故障率也会产生很多bug报告,以至于超过编程团队的处理极限。通过这些减少bug反馈信息的措施,编程团队能够更专注于开发玩家想要的新功能而不是去给bug分类。
当然还有更多bug
我认为现在还没有到计算机程序不会出现bug的阶段——用户期望的增长要比高级程序员的数量更快。Warcraft I大约有20万行代码(包括内部工具),而GW I的代码量已经超过了650万行(也包括工具)。尽管可以降低每行代码中bug出现的几率,但代码行数的巨大增长仍然会导致问题数的剧增。但我们仍在努力。
后,我想分享一下在Blizzard时的同事——Bob Fitch的一句玩笑话,他说道:“所有代码都可以优化,但所有程序都有bug,因此所有程序都可以被优化为一行代码,只不过无法运行。”这是为什么我们总有bug。
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11