XuedongSun(sunxued@mail.sysu.edu.cn)SchoolofSoftware,SunYat-senUniversitySE-307SoftwareTesting2先修课程&后续课程先修课程离散数学和图论(DiscretemathematicsandGraphTheory)高级程序设计语言(AdvancedProgrammingLanguage)软件工程导论(IntroductiontoSoftwareEngineering)数据库系统(DatabaseSystems)编译原理(PrinciplesofCompilerConstruction)后续课程软件质量保证(SoftwareQualityAssurance)软件过程改进(SoftwareProcessImprovement)3Textbook:R.Patton.SoftwareTesting,2ndEd.Sams,2005,ISBN0-672-32798-8影印版:《软件测试》(第2版),经典原版书库,北京:机械工业出版社,2006,ISBN7-111-17770-3References:P.Jorgensen.SoftwareTesting:ACraftsman'sApproach,2ndEd.CRCPress,2002,ISBN0-849-30809-7A.Mathur.FoundationsofSoftwareTesting.Addison-WesleyProfessional,2008,ISBN8-131-71660-04成绩计算综合成绩=平时考勤+大作业成绩+期末考试20%40%40%教学网站用户名:sser,密码:ToBeNo.15ContentsPartI.TheBigPicture(6hours)PartII.TestingFundamentals(24+3hours)PartIII.ApplyingYourTestingSkills(3hours)PartIV.SupplementingYourTesting(3hours)PartV.WorkingwithTestDocumentation(3+3hours)PartVI.TheFuture(2hours)6ObjectivesUnderstandthebasicconceptsofsoftwaretesting;Performeffectiveandefficientstructuralandfunctionaltestingofyoursoftware;Integrateandtestthevariousunitsandcomponentsofyoursoftwaresystem;Selecttheappropriateteststoregressiontestyoursoftwareafterchangeshavebeenmade;Plan,trackandcontrolthesoftwaretestingeffort.PartI:TheBigPictureSoftwareTesting8ContentsDefinitionofsoftwaretestingSoftwareTestingFrameworkSoftwareTestingBackgroundTheSoftwareDevelopmentProcessTheRealitiesofSoftwareTestingThedefinitionofsoftwaretestingTheuseofmanualorautomaticmeanstorunordeterminationofasystematicprocess.Itspurposeistotestwhetheritneedstomeettherequirementsorexpectedresultstoidentifythedifferencebetweentheactualresults.-------IEEE1983910SoftwareTestingFrameworkBasictesttheoryandtechnologyTestStandardsandCriteriaTestenvironmentandtoolsTestManagementPart1Section1SoftwareTestingBackground12ContentsInfamousSoftwareErrorCaseStudiesWhatIsaBug?WhyDoBugsOccur?TheCostofBugsWhatExactlyDoesaSoftwareTesterDo?WhatMakesaGoodSoftwareTester?13InfamousSoftwareErrorCaseStudiesDisney'sLionKing,1994-1995IntelPentiumFloating-PointDivisionBug,1994(4195835/3145727)*3145727–4195835NASAMarsPolarLander,1999PatriotMissileDefenseSystem,1991TheY2K(Year2000)Bug,circa1974DangerousViewingAhead,200414WhatIsaBug?TermsforSoftwareFailuresDefect(缺点),Fault(故障),Failure(失败),Variance(偏差),Incident(事件),Anomaly(异常),Problem(问题),Inconsistency(矛盾),Error(错误),Feature(特殊),Bug(缺陷),It'simportantasasoftwaretestertounderstandthepersonalitybehindtheproductdevelopmentteamyou'reworkingwith.Allsoftwareproblemswillbecalledbugs.15SoftwareBug:AFormalDefinitionAsoftwarebugoccurswhenoneormoreofthefollowingfiverulesistrue:Thesoftwaredoesn'tdosomethingthattheproductspecificationsaysitshoulddo.Thesoftwaredoessomethingthattheproductspecificationsaysitshouldn'tdo.Thesoftwaredoessomethingthattheproductspecificationdoesn'tmention.Thesoftwaredoesn'tdosomethingthattheproductspecificationdoesn'tmentionbutshould.Thesoftwareisdifficulttounderstand,hardtouse,slow,orinthesoftwaretester'seyeswillbeviewedbytheenduserasjustplainnotright.16WhyDoBugsOccur?Themaincausecanbetracedtothespecification.Thenextlargestsourceofbugsisthedesign.Codingerrorscanbetracedtothesoftware'scomplexity,poordocumentation(especiallyincodethat'sbeingupdatedorrevised),schedulepressure,orjustplaindumbmistakes.Theothercategoryisthecatch-allforwhat'sleft.17TheCostofBugsThecostsarelogarithmicthatis,theyincreasetenfoldastimeincreases.Abugfoundandfixedduringtheearlystageswhenthespecificationisbeingwrittenmightcostnexttonothing,or$1inourexample.Thesamebug,ifnotfounduntilthesoftwareiscodedandtested,mightcost$10to$100.Ifacustomerfindsit,thecostcouldeasilybethousandsorevenmillionsofdollars.18WhatExactlyDoesaSoftwareTesterDo?Thegoalofasoftwaretesteristofindbugs.Thegoalofasoftwaretesteristofindbugsandfindthemasearlyaspossible.Thegoalofasoftwaretesteristofindbugs,findthemasearlyaspossible,andmakesuretheygetfixed.Note:It'simportanttonotethatfixingabugdoesnotnecessarilyimplycorrectingthesoftware.19WhatMakesaGoodSoftwareTester?Here'salistoftraitsthatmostsoftwaretestersshouldhave:Theyareexplorers.Theyaretroubleshooters.Theyarerelentless.Theyarecreative.Theyareperfectionists.Theyexercisegoodjudgment.Theyaretactfulanddiplomatic.Theyarepersuasive.20SummaryHighlightsofthischapterHowsoftwarebugsimpactourlivesWhatbugsareandwhytheyoccurWhosoftwaretestersareandwhattheydoPart1Section2TheSoftwareDevelopmentProcess22ContentsProductComponentsSoftwareProjectStaffSoftwareDevelopmentLifecycleModels23ProductComponentsWhatEffortGoesIntoaSoftwareProduct?24ProductComponentsWhatPartsMakeUpaSoftwareProduct?25SoftwareProjectStaffProjectmanagers,programmanagers,orproducersdrivetheprojectfrombeginningtoend.Architectsorsystemengineersarethetechnicalexpertsontheproductteam.Programmers,developers,orcodersdesignandwritesoftwareandfixthebugsthatarefound.TestersorQA(QualityAssurance)Staffareresponsibleforfindingandreportin