资源描述:
《防不胜防的软件错误——例11963年,美国,飞往火星的》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、防不胜防的软件错误——例1:1963年,美国,飞往火星的火箭爆炸,损失$10million.原因:FORTRAN循环DO5I=1,3误写为DO5I=1.3第七章测试(Testing)例2:1996年,美国WashingtonPost报导Dallas,Aug.23—ThecaptainofanAmericanAirlinesjetthatcrashedinColombialastDecemberenteredanincorrectone-lettercomputercommandthatsenttheplaneintoamountain,theairlinesaidtoday.第七章测试
2、.Thecrashkilledallbutfourofthe163peopleaboard.American’sinvestigatorsconcludedthatthecaptainoftheBoeing757apparentlythoughthehadenteredthecoordinatesfortheintendeddestination,Cali.ButonmostSouthAmericanaeronauticalcharts,theone-lettercodeforCaliisthesameastheoneforBogota,132milesintheoppositedir
3、ection.ThecoordinatesforBogotadirectedtheplanetowardthemountain,accordingtoaletterbyCecilEwell,American’schiefpilotandvicepresidentforflight.ThecodesforBogotaandCaliaredifferentinmostcomputerdatabases,Ewellsaid.例3:[摘自Pfleeger书中的“REAL-TIMEEXAMPLE”]Ourreal-timeexampleisbasedontheembeddedsoftwarein
4、theAriane-5,aspacerocketbelongingtotheEuropeanSpaceAgency(ESA).OnJune4,1996,onitsmaidenflight,theAriane-5waslaunchedandperformedperfectlyforapproximately40seconds.Then,itbegantoveeroffcourse.AtthedirectionofanArianegroundcontroller,therocketwasdestroyedbyremotecontrol.Thedestructionoftheuninsure
5、drocketwasalossnotonlyoftherocketitself,butalsoofthefoursatellitesitcontained;thetotalcostofthedisasterwas$500million.第七章测试.第七章测试.Thebusinessimpactoftheincidentwentwellbeyondthe$500millioninequipment.In1996,theAriane-4rocketandpreviousvariantsheldmorethanhalfoftheworld’slaunchcontracts,aheadofAm
6、erican,Russian,andChineselaunchers.Thus,thecredibilityoftheprogramwasatstake,aswellasthepotentialbusinessfromfutureArianerockets.Cause:TherewasnodiscussionintheSRI(InertialReferenceSystem)requirementsdocumentsofthewaysinwhichtheAriane-5trajectorywouldbedifferentfromAriane-4.软件测试是保证软件质量的关键步骤,是对软件
7、规格说明、设计和编码的最后复审,其工件量约占总工作量40%以上(对于人命关天的情况,测试相当于其它部分总成本的3—5倍)。第七章测试.§1.基本概念1、定义:测试是为了发现程序中的错误而执行程序的过程。注意:①只能尽可能查错,不能证明程序中没有错;②测试员与程序员不应是同一个人。2、黑盒和白盒测试黑盒测试(black-box,orclosed-boxtesting):Makesurethateverykindofinputissubmitte