激angY,LiM,ZhouZH.SoftwaredefectdetectionwithRocus.JOURNALOFCOMPUTERSCIENCEANDTECH-NOLOGY26(2):328{342Mar.2011.DOI10.1007/s11390-011-1135-6SoftwareDefectDetectionwithROCUSYuan激ang(姜远),Member,CCF,MingLi(黎铭)¤,Member,CCF,ACM,IEEEandZhi-HuaZhou(周志华),SeniorMember,CCF,IEEE,Member,ACMNationalKeyLaboratoryforNovelSoftwareTechnology,Nan激ngUniversity,Nan激ng210093,ChinaE-mail:f激angyuan,lim,zhouzhg@nju.eduReceivedMay15,2009;revisedOctober26,2010.AbstractSoftwaredefectdetectionaimstoautomaticallyidentifydefectivesoftwaremodulesfore±cientsoftwaretestinordertoimprovethequalityofasoftwaresystem.Althoughmanymachinelearningmethodshavebeensuccessfullyappliedtothetask,mostofthemfailtoconsidertwopracticalyetimportantissuesinsoftwaredefectdetection.First,itisratherdi±culttocollectalargeamountoflabeledtrainingdataforlearningawell-performingmodel;second,inasoftwaresystemthereareusuallymuchfewerdefectivemodulesthandefect-freemodules,solearningwouldhavetobeconductedoveranimbalanceddataset.Inthispaper,weaddressthesetwopracticalissuessimultaneouslybyproposinganovelsemi-supervisedlearningapproachnamedRocus.Thismethodexploitstheabundantunlabeledexamplestoimprovethedetectionaccuracy,aswellasemploysunder-samplingtotackletheclass-imbalanceprobleminthelearningprocess.Experimentalresultsofreal-worldsoftwaredefectdetectiontasksshowthatRocusise®ectiveforsoftwaredefectdetection.Itsperformanceisbetterthanasemi-supervisedlearningmethodthatignorestheclass-imbalancenatureofthetaskandaclass-imbalancelearningmethodthatdoesnotmakee®ectiveuseofunlabeleddata.Keywordsmachinelearning,datamining,semi-supervisedlearning,class-imbalance,softwaredefectdetection1IntroductionEnabledbytechnologicaladvancesincomputerhardware,softwaresystemshavebecomeincreasinglypowerfulandversatile.However,theattendantincreaseinsoftwarecomplexityhasmadethetimelydevelop-mentofreliablesoftwaresystemsextremelychallenging.Tomakesoftwaresystemsreliable,itisveryimportanttoidentifyasmanydefectsaspossiblebeforereleas-ingthesoftware.However,duetothecomplexityofthesoftwaresystemsandthetightprojectschedule,itisalmostimpossibletoextensivelytesteverypathofthesoftwareunderallpossibleruntimeenvironment.Thus,accuratelypredictingwhetherasoftwaremodulecontainsdefectscanhelptoallocatethelimitedtestresourcese®ectively,andhence,improvethequalityofsoftwaresystems.Suchaprocessisusuallyreferredtoassoftwaredefectdetection,whichhasalreadydrawnmuchattentioninsoftwareengineeringcommunity.Machinelearningtechniqueshavebeensuccessfullyappliedtobuildingpredictivemodelsforsoftwaredefectdetection[1-7].Thestaticanddynamiccodeattributesorsoftwaremetricsareextractedfromeachsoftwaremoduletoformanexample,whichisthenlabeledas\defective"or\defect-free".Predictivemodelswhichlearnfromalargenumberofexamplesareexpectedtoaccuratelypredictwhetheragivenmoduleisdefective.However,mostofthesestudieshavenotconsideredtwopracticalyetimportantissuesinsoftwaredefectdetection.First,althoughitisrelativelyeasytoauto-maticallygenerateexamplesfromsoftwaremodulesus-ingsomestandardtools,determiningwhetheramodulecontainsdefectthroughextensivetestusuallyconsumestoomuchtimeandresource,sincethenumberofpro-gramstatusgrowsexponentiallyasthecomplexityofsoftwareincreases.Withlimitedtimeandtestresource,onecanonlyobtainthelabelsforasmallportionofmodules.However,thepredictivemodelsthatlearnfromsuch...