ACMTransactionsonSoftwareEngineeringandMethodology(toappear)AnEmpiricalStudyofRegressionTestSelectionTechniquesToddL.GravesMaryJeanHarroldyJung-MinKimzAdamPorterxGreggRothermel{AbstractRegressiontestingistheprocessofvalidatingmodiedsoftwaretodetectwhethernewerrorshavebeenintroducedintopreviouslytestedcode,andprovidecondencethatmodicationsarecorrect.Sinceregressiontestingisanexpensiveprocess,researchershaveproposedregressiontestselectiontechniquesasawaytoreducesomeofthisexpense.Thesetechniquesattempttoreducecostsbyselectingandrunningonlyasubsetofthetestcasesinaprogram'sexistingtestsuite.Althoughtherehavebeensomeanalyticalandempiricalevaluationsofindividualtechniques,toourknowledgeonlyonecomparativestudy,focusingononeaspectoftwoofthesetechniques,hasbeenreportedintheliterature.Weconductedanexperimenttoexaminetherelativecostsandbenetsofseveralregressiontestselectiontechniques.Theexperimentexaminedvetechniquesforreusingtestcases,focusingontheirrelativeabilitiestoreduceregressiontestingeortanduncoverfaultsinmodiedprograms.Ourresultshighlightseveraldierencesbetweenthetechniques,andexposeessentialtradeosthatshouldbeconsideredwhenchoosingatechniqueforpracticalapplication.1INTRODUCTIONAsdevelopersmaintainasoftwaresystem,theyperiodicallyregressiontestit,hopingtonderrorscausedbytheirchanges,andprovidecondencethattheirmodicationsarecorrect.Tosupportthisprocess,developersoftencreateaninitialtestsuite,andthenreuseitforregressiontesting.Thesimplestregressiontestingstrategy,retestall,rerunseverytestcaseintheinitialtestsuite.Thisapproach,however,canbeprohibitivelyexpensive{rerunningalltestcasesinthetestsuitemayrequireanunacceptableamountoftime.Analternativeapproach,regressiontestselection,rerunsonlyasubsetoftheinitialtestsuite.Ofcourse,thisapproachisimperfectaswell{regressiontestselectiontechniquescanhavesubstantialcosts,andcandiscardtestcasesthatcouldrevealfaults,possiblyreducingfaultdetectioneectiveness.Thistradeobetweenthetimerequiredtoselectandruntestcasesandthefaultdetectionabilityofthetestcasesthatareruniscentraltoregressiontestselection.Becausetherearemanywaysinwhichtoapproachthistradeo,avarietyoftestselectiontechniqueshavebeenproposed(e.g.,[1,4,7,8,12,15,20]).Althoughtherehavebeensomeanalyticalandempiricalevaluationsofindividualtechniques[4,18,20,21],toourknowledgeonlyonecomparativestudy,focusingononeaspectoftwoofthesetechniques,hasbeenreportedintheliterature[16].Wehypothesizethatdierentregressiontestselectiontechniquescreatedierenttradeosbetweenthecostsofselectingandexecutingtestcases,andtheneedtoachievesucientfaultdetectionability.Becausetherehavebeenfewcontrolledexperimentstoquantifythesetradeos,weconductedsuchastudy.OurresultsindicatethatthechoiceofregressiontestselectionalgorithmsignicantlyaectstheNationalInstituteofStatisticalSciences,andSoftwareProductionResearchDepartment,BellLaboratories,1000E.War-renvilleRd.,Naperville,IL60566,graves@bell-labs.com.yDepartmentofComputerandInformationScience,OhioStateUniversity,harrold@cis.ohio-state.edu.zDepartmentofComputerScience,UniversityofMarylandatCollegePark,jmkim@cs.umd.edu.xDepartmentofComputerScience,UniversityofMarylandatCollegePark,aporter@cs.umd.edu.{DepartmentofComputerScience,OregonStateUniversity,grother@cs.orst.edu.cost-eectivenessofregressiontesting.Belowwereviewtherelevantliterature,describethetestselectiontechniquesweexamined,andpresentourexperimentaldesign,analysis,andconclusions.2REGRESSIONTESTINGSUMMARYANDLITERA-TUREREVIEW2.1RegressionTestingLetPbeaprocedureorprogram,letP0beamodiedversionofP,andletTbeatestsuiteforP.Atypicalregressiontestproceedsasfollows:1.SelectT0T,asetoftestcasestoexecuteonP0.2.TestP0withT0,establishingP0'scorrectnesswithrespecttoT0.3.Ifnecessary,createT00,asetofnewfunctionalorstructuraltestcasesforP0.4.TestP0withT00,establishingP0'scorrectnesswithrespecttoT00.5.CreateT000,anewtestsuiteandtestexecutionproleforP0,fromT,T0,andT00.Eachofthesestepsinvolveimportantproblems.Step1involvestheregressiontestselectionproblem:theproblemofselectingasubsetT0ofTwithwhichtotestP0.Step3addressesthecoverageidenticationproblem:theproblemofidentifyingportionsofP0oritsspecicationthatrequireadditionaltesting.Steps2and4addressthetestsuiteexecutionproblem:theproblemofecientlyexecutingtestsuitesandcheckingtestresultsforcorrectness.Step5addressesthetestsuitemaintenanceproblem:theproblemofupdatingandstoringtestinformation.Althougheachoftheseproblemsissignicant,werestrictourattentiontotheregressiontestselectionproblem.Notethatregressiontestselectionisapplicablebothincaseswherethespecicationshavenotchanged,andwheretheyhavechanged.Inthelattercase,itisnecessarytoidentifythetestcasesinTthatareobsoleteforP0priortoperformingtestselection.(TestcasetisobsoleteforprogramP0ifandonlyiftspeciesaninputtoP0thatisinvalidforP0,ortspeciesaninvalidinput-outputrelationforP0.)HavingidentiedthesetestcasesandremovedthemfromT,regressiontestselectioncanbeperformedontheremainingtestcases.Notefurtherthattheidenticationofobsoletetestcasesisnecessaryif