資源描述:
《測(cè)試用例設(shè)計(jì)(白盒oo)ppt培訓(xùn)課件》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、軟件測(cè)試和質(zhì)量保證OO測(cè)試用例設(shè)計(jì)本章要點(diǎn)以覆蓋準(zhǔn)則為切入點(diǎn),討論基于系統(tǒng)內(nèi)部實(shí)現(xiàn)的測(cè)試方法基本路徑測(cè)試覆蓋準(zhǔn)則基本控制流的測(cè)試基于數(shù)據(jù)流的測(cè)試基于程序變異的測(cè)試面向?qū)ο蟮臏y(cè)試面向?qū)ο蟮臏y(cè)試問題和失效模式OOTestDesignMethodScopeClassScopeFlattenedClassScopeClassScopeCoverageCriteriaOOTestingProblemsThehopeforreductioninOOTestingduetoreuseisillusoryInheritance,polymorphism,latebindingandencapsulationp
2、resentsomenewproblemsfortestcasedesign,testabilityandcoverageanalysisThetestmethodshouldbechangeeasilyaccordingtotheiterationandincrementoodevelopmentTestingactivitiesshouldberegardedasaprofessionaloodevelopmentEncapsulationAaccesscontrolmechanismpresentanobstacletotestingExampleInheritanceLSP子類應(yīng)當(dāng)可以
3、替換父類并出現(xiàn)在父類可以出現(xiàn)的任何地方類的擴(kuò)展原則類的繼承原則RelatedBugsIncorrectinitialization(supposeifsuper’sinitializationiswrong)inadvertentbinding(datamemberlifecycle)Missingoverride:copy,isEqualNakedaccess:subclassaccesstothesuperclassdatamemberwithoutstricklycontrolingSpaghettiinheritance:tooheavymultipleinheritanceandde
4、ephierarchies(>6)Naughtychildren:subclasseitherdoesnotacceptallmessagesthatsuperclassacceptsorleavestheobjectinastatethatisillegalinthesuperclassFatinterface:AsubclassinheritsmethodsthatareinappropriateorirrelevantOOBugHazardsTheinteractionofindividuallycorrectsuperclassandsubclassmethodscanbebuggy.
5、InteractionmustbesystematicallyexercisedOmittingasubclassoverrideforahigh-levelsuperclassmethodinadeepinheritancehierachyiseasySuperclasstestsuitesmustbererunonsubclassesandconstructedsothattheycanbereusedtotestanysubclassPoordesignofclasshierarchiessupportingdynamicbindingcanresultinfailuresofasubc
6、lasstoobservesuperclasscontractsAllbindingsmustbesystematicallyexercisedtorevealthesebugsOOBugHazardsThelossofintellectualcontrolthatresultfromspaghettipolymorphismisabugharzardAclientofapolymorphicservercanbeconsideredhavebeenadequatelytestedonlyifallserverbindingsthattheclientcangeneratehavebeenex
7、ercisedClasswithsequentialconstrainsonmethodactivationandtheirclientscanhavecontrolbugs.Subclassmayfailingtoobservestatemodelofsuperclass,sosubclassshouldbetestedinflattenedmodelDomainTestingTestStrat