TestingofObject-OrientedProgrammingSystems(OOPS):AFault-BasedApproachJaneHuffmanHayesScienceApplicationsInternationalCorporation1213Jefferson-DavisHighway,Suite1300Arlington,Virginia22202Abstract.Thegoalofthispaperistoexaminethetestingofobject-orientedsystemsandtocompareandcontrastitwiththetestingofconventionalprogramminglanguagesystems,withemphasisonfault-basedtesting.Conventionalsystemtesting,object-orientedsystemtesting,andtheapplicationofconventionaltestingmethodstoobject-orientedsoftwarewillbeexamined,followedbyalookatthedifferencesbetweentestingofconventional(procedural)softwareandthetestingofobject-orientedsoftware.Anexaminationofsoftwarefaults(defects)willfollow,withemphasisondevelopingapreliminarytaxonomyoffaultsspecifictoobject-orientedsystems.Teststrategyadequacywillbebrieflypresented.Asaresultoftheseexaminations,asetofcandidatetestingmethodsforobject-orientedprogrammingsystemswillbeidentified.1IntroductionandOverviewTwomajorforcesaredrivingmoreandmorepeopletowardObject-OrientedProgrammingSystems(OOPS):theneedtoincreaseprogrammerproductivity,andtheneedforhigherreliabilityofthedevelopedsystems.Itcanbeexpectedthatsometimeinthenearfuturetherewillbereusabletrustedobjectlibrariesthatwillrequirethehighestlevelofintegrity.AllthispointstotheneedforameansofassuringthequalityofOOPS.Specifically,ameansforperformingverificationandvalidation(V&V)onOOPSisneeded.Thegoalofthispaperistoexaminethetestingofobject-orientedsystemsandtocompareandcontrastitwiththetestingofconventionalprogramminglanguagesystems,withemphasisonfault-basedtesting.1.1IntroductiontoObject-OrientedProgrammingSystems(OOPS)Object-OrientedProgrammingSystems(OOPS)arecharacterizedbyseveraltraits,withthemostimportantonebeingthatinformationislocalizedaroundobjects(asopposedtofunctionsordata)[3].Meyerdefinesobject-orienteddesignastheconstructionofsoftwaresystemsasstructuredcollectionsofabstractdatatypeimplementations[15].TounderstandOOPS,severalhighlevelconceptsmustbeintroduced:objects,classes,inheritance,polymorphism,anddynamicbinding.Objectsrepresentreal-worldentitiesandencapsulateboththedataandthefunctions(i.e.,behaviorandstate)whichdealwiththeentity.Objectsarerun-timeinstancesofclasses.Classesdefineasetofpossibleobjects.Aclassismeanttoimplementauser-definedtype(ideallyanAbstractDataType(ADT)tosupportdataabstraction).Thegoalistokeeptheimplementationdetailsprivatetotheclass(informationhiding).Inheritancereferstotheconceptofanewclassbeingdeclaredasanextensionorrestrictionofapreviouslydefinedclass[15].Polymorphismreferstotheabilitytotakemorethanoneform.Inobject-orientedsystems,itreferstoareferencethatcan,overtime,refertoinstancesofmorethanoneclass.Thestatictypeofthereferenceisdeterminedfromthedeclarationoftheentityintheprogramtext.Thedynamictypeofapolymorphicreferencemaychangefrominstanttoinstantduringtheprogramexecution.Dynamicbindingreferstothefactthatthecodeassociatedwithagivenprocedurecallisnotknownuntilthemomentofthecallatrun-time[12].Applyingtheprinciplesofpolymorphismandinheritance,itcanbeenvisionedthatafunctioncallcouldbeassociatedwithapolymorphicreference.Thusthefunctioncallwouldneedtoknowthedynamictypeofthereference.Thisprovidesatremendousadvantagetoprogrammersoverconventionalprogramminglanguages(oftenreferredtoasprocedurallanguages):theabilitytorequestanoperationwithoutexplicitlyselectingoneofitsvariants(thischoiceoccursatrun-time)[16].1.2IntroductiontoVerificationandValidation(V&V)Verificationandvalidationreferstotwodifferentprocessesthatareusedtoensurethatcomputersoftwarereliablyperformsthefunctionsthatitwasdesignedtofulfill.Thoughdifferentdefinitionsofthetermsverificationandvalidationexist,thefollowingdefinitionsfromANSI/IEEEStandard729-1983[10]arethemostwidelyacceptedandwillbeusedinthispaper:Verificationistheprocessofdeterminingwhetherornottheproductsofagivenphaseofthesoftwaredevelopmentcyclefulfilltherequirementsestablishedduringthepreviousphase.Validationistheprocessofevaluatingsoftwareattheendofthesoftwaredevelopmentprocesstoensurecompliancewithsoftwarerequirements.1.3IntroductiontoTestingTestingisasubsetofV&V.TheIEEEdefinitionoftestingistheprocessofexercisingorevaluatingasystemorsystemcomponentbymanualorautomatedmeanstoverifythatitsatisfiesspecifiedrequirementsortoidentifydifferencesbetweenexpectedandactualresults.[10].Conventionalsoftwaretestingisdividedintotwocategories:statictestinganddynamictesting.Statictestinganalyzesaprogramwithoutexecutingitwhiledynamictestingreliesonexecutionoftheprogramtoanalyzeit[5].Thefocusofthispaperwillbedynamictesting.Dynamictestingisoftenbrokenintotwocategories:black-boxtestingandwhite-boxtesting.Black-boxtestingreferstofunctionaltestingwhichdoesnottakeadvantageofimplementationdetailsandwhichexaminestheprogram'sfunctionalproperties.White-boxtesting,ontheotherhand,usesinformationabouttheprogram'sinternalcontrolflowstructureordatadependencies.1.4ResearchApproachFigure1.4-1depictstheresearchapproachtobetakeninthispaper.Theexaminationofconventionalsystemtesting,object-orientedsystemtesting,andtheapplica