《TestCaseDesigning》由会员分享,可在线阅读,更多相关《TestCaseDesigning(22页珍藏版)》请在金锄头文库上搜索。
1、TestCaseDesigningYujuandou(窦玉娟)MSN:13858191626InformationbeforeclassnFilesonhttp:/ Specifications2.Designbased Logicalsystem3.CodebasedCode4.ExtractedExistingfilesortestcases5.ExtremeLimitsandboundaryconditionsSources1.Identifythebasiccasesthatindicateprogramfunctionality.2.Createaminimalsetoftestst
2、ocoverallinputsandoutputs.3.Breakdowncomplexcasesintosinglecases.4.Removeunnecessaryorduplicatecases.5.Reviewsystematicallyandthoroughly.Stepsforselectingtestcases:RequirementbasedtestcasesLooksforexceptionalconditions,extremes,boundaries,andabnormalities. Requiresexperience,creativityoftheTestEngin
3、eerNeed:ExtremecasesExtractedcasesinvolvedextractingsamplesofrealdataforthetestingprocess.Randomizedcasesinvolvedusingtoolstogeneratepotentialdataforthetestingprocess.ExtractedandRandomizedcases1.EquivalencePartitioning 2.BoundaryValueAnalysis3.ErrorGuessingTestcaseDesignmethodsEquivalence classisas
4、ubsetofdatathatisrepresentativeofalargerclassDivideinputdomainintoequivalenceclassesAttempttocoverclassesoferrorsOnetestcaseperequivalenceclass,toreducetotalnumberoftestcasesneeded InputDomainEquivalencepartitioningAprogramwhichacceptscreditlimitswithagivenrangeSay,$10,000$15,000Thiswouldhavethreeeq
5、uivalenceclasses:-1.Lessthan$10,000(Invalid)2.Between$10,000and$15,000 (Valid)3.Greaterthan$15,000(Invalid)ExampleLess than 10,000Between 10 and 15More than 15,00098001250018000EquivalencePartitionsComplementsequivalencepartitioning,selectsthetestcasesatthe“edge”ofequivalenceclasses.Inpractice,moree
6、rrorsfoundatboundariesofequivalenceclassesthanwithintheclassesDivideinputdomainintoequivalenceclassesAtechniquethatconsistsofdevelopingtestcasesanddatathatfocusontheinputandoutputboundariesofagivenfunctionBoundaryValueAnalysisInthesamecreditlimitexample:theboundaryanalysiswouldtest1.lowboundarypluso
7、rminusone($9,999and$10,001)2.Ontheboundary($10,000and$15000)3.Upperboundaryplusorminusone($14999and$15001)Example1.Valueimmediatelybelowrange2.Firstvalueofrange3.Secondvalueofrange4.Valueimmediatelybelowlastvalueofrange5.Lastvalueofrange6.Valueimmediatelyaboverange RangeofBoundaryValuesBased on the
8、theory that test cases can be developed based upon the intuition andexperience of the Test Engineer.In an example where one of the inputsis the date and the Test Engineer may try February 29, 2000 or 9/9/9999ErrorGuessingTestCaseDesigntechniquesnSpecial value testing-Selectingdatabasedonthebasisofth
9、efeaturesofthefunctiontobecomputediscalledspecialvaluetesting.ThisisapplicablemainlytomathematicalcomputationsTestCaseDesign-BestpracticenBestpracticeistodevelopatleasttwotestcasesforeachrequirementfortest:atestcasetodemonstratetherequirementhasbeenachieved,oftenreferredtoasapositivetestcase,another
10、testcase,reflectinganunacceptable,abnormal,orunexpectedconditionordata,todemonstratethattherequirementisonlyachievedunderthedesiredcondition,referredtoasanegativetestcases.ToCaptureTestCaseDetails:1.TestcaseID(shouldbeunique,eg:c_01.1,c_01.1a,c_01.2,)2.Featurefunctionalitytobetested(eachRequirement/featurecouldbefromUsecase)3.TestDescription/testinputdetails(testinput,testdata,actiontobeperformedtotestthefeature,complextestcasesbesplittomorethanone)4.Expectedbehavior(inmessages,screens,data,tobewithcorrectdetails)5.ActualandStatusTestCoveragenRequirementscoveragenCodeCoveragen.n.n.n.