代码没问题 程序却有bug?

发表于:2013-1-11 11:34

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:王然    来源:51Testing软件测试网采编

分享:

  在正常的计算机中,这样的压力测试不会出问题,但有大约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。

33/3<123
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号