/
Ourndingsshowthat19%oftheexaminedstacktraceshadapimethodswithundocume Ourndingsshowthat19%oftheexaminedstacktraceshadapimethodswithundocume

Our ndingsshowthat19%oftheexaminedstacktraceshadapimethodswithundocume - PDF document

ellena-manuel
ellena-manuel . @ellena-manuel
Follow
387 views
Uploaded On 2016-08-17

Our ndingsshowthat19%oftheexaminedstacktraceshadapimethodswithundocume - PPT Presentation

2httpdocsoraclecomjavase7docsapijavalangThrowablehtml3httpswwwbugsensecom4httpwwwsplunkcom Figure1Identi cationofriskymethods Figure2ExtractionofapiexceptionsTheinvestigatio ID: 450683

2http://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html3https://www.bugsense.com/4http://www.splunk.com/ Figure1:Identi cationofriskymethods Figure2:ExtractionofapiexceptionsTheinvestigatio

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Our ndingsshowthat19%oftheexaminedstackt..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Our ndingsshowthat19%oftheexaminedstacktraceshadapimethodswithundocumentedexceptions.Thismeansthatthesecrashescouldhavebeenavoidediftheinvolvedmethodshaddocumentationforpossiblethrownexceptions.Also,contrarytoourexpectations,werealizedthat40%ofthedocumentedexceptionsintheAndroidsourcecodearespeci cuncheckedexceptions,namely:IllegalArgumentEx-ception,NullPointerException,IllegalStateException.Inthefollowingsections,we rstdescribeourdataset(Section2).Then,weoutlineourmethods(Section3).InSection4,wepresentourresultsandinSection5wemakeadiscussionandrefertothethreatstovalidityofourstudy.Finally,weendupwithrelatedwork(Section6)andourconclusions(Section7).2.DATAForthepurposesofthisstudyweusedadatasetof4,900Javastacktraces(seeprintStackTrace())2fromAndroidapplicationcrashes.TheproviderofthedatasetwasaGreekstartupcalledBugSense,3whichiscurrentlyacompanyofSplunk.4BugSenseo ersacentralizedcrashreportmanage-mentservicethatcollectsstacktracesfromapplicationsthathavebeencrashedandhaveinstalledtheBugSensesdk.Speci cally,weanalyzed4,902distinctcrashreportsfrom1,800di erentAndroidapplicationsthatrunondeviceswiththeAndroidapilevel15(4.0.3{4.0.4).OurdatasetwascollectedontheMayof2012.Inaddition,wedownloadedtheAndroidsdkandusedthesourcecodeoftheAndroidapi(level15).Weparsed2,171Java leswithonlinedocu-mentation.AndroidisanembeddeddevicebasedontheLinuxoperat-ingsystemthatcanhostmobileapplications.Brie y,inthebottomlayerofAndroidframeworkthereistheLinuxkernel.Thekernelistheborderbetweenthedeviceandthesoftwareanditprovidesservicessuchasmemorymanagement,net-working,andpowermanagement.InthemiddlelayerthereistheDalvikvirtualmachineandtheJavaNativeInterface.Dalviksupportstheexecutionofmultipleapplicationsonthesystem.TheJavaNativeInterfaceisusedtoperformcallsfromJavacodeintonativecode.Finally,onthetoplayerthereareseveralJavaclassesfrom:1)coreapplications(contacts,phone,browser),2)third-partyapplications,and3)theJavaPlatform(J2SE).3.METHODSToidentifymethodsfromtheAndroidapithatlackcriti-caldocumentation,weworkedintwodirections.First,wepinpointedapimethodspossiblyresponsibleforcrashesandlinkedthemethodswiththethrownstacktraceexceptions(Figure1).Second,weparsedthesourcecodeoftheAn-droidapianddrewmethodswithdocumentedexceptions(Figure2).Thus,havingasetofriskyapimethodsandknowingthedocumentedexceptionsoftheAndroidapi,wewereabletolistmethodsthatareinvolvedincrashesandhaveundocumentedexceptions.Followingweexplainourtechniquesindetails.3.1IdenticationofRiskyMethods 2http://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html3https://www.bugsense.com/4http://www.splunk.com/ Figure1:Identi cationofriskymethods Figure2:ExtractionofapiexceptionsTheinvestigationofriskyapiscanbemadeinseveralways.Forinstance,examiningthedocumentationand ndingcomplicatedapisthatleaddeveloperstotheviolationoftheapis'invariantsorpreconditions.Also,throughfuzztestingbypassingrandomvaluesasmethodinputs[3].Here,weempiricallyidenti edriskyapisbasedontheirfrequentmanifestationonapplicationcrashes.Inoursample,stacktracesconsistofmethodcallsfromtheAndroidframeworkthatleadtoanexception,possiblythroughanapplicationandanapi.Weassertthatthelastinstanceonanapplication|apipairisanapicallthatcanleadtoanapplicationcrash.Thus,bylocatingsuchapicallswecan ndapimethodsthatpossiblycontributetoapplicationcrashes.InListing1,setContentViewissuchanexample.Then,takingalsointoaccounttherootexceptionandtheexceptionsfromtherestframes(forchainedstacktraces),wecouldhavemoreconciseinformationaboutthereasonofacrash.Listing1:Methodcallssequencecom.example.Serialize$Looper.runandroid.os.Looper.loopandroid.os.Handler.dispatchMessagecom.example.SerializeHandler.onMessagecom.example.app.Activity$1.workandroid.app.Activity.setContentViewFinally,inthebeginningofourstudy,weappliedsomebasic lteringtoconformourdatasetinanappropriateformatforanalysisandremovedmetadatafromourcrashreports.3.2ExtractionofDocumentedExceptionsToidentifymethodswithdocumentedexceptions(checkedandunchecked),wedownloadedandparsedtheAndroidsourcecodeoftheapi(version15).FromtheJava leswekeptonlytheclassesthathaveonlinedocumentationintheAndroidreference.5Then,wewroteaJavadoclet6thatidenti esmethodswith@throwscommentsanddeclaredex-ceptionsintheirsignatures;weexcludedtheprivatemethodsastheydonotappearintheonlinedocumentation.Thus,wegotasetofmethodswithdocumentedexceptions.Finally,wereadthe lesproducedbythedocletandorganizedthemethodsinadictionarybasedontheirnames.4.RESULTSFromtheanalysisoftheAndroidsourcecode,wefoundthatonly18%ofdistinctnon-privateapimethods(groupedbyname)haddocumentedexceptions(56%checkedand 5http://developer.android.com/reference/classes.html6http://docs.oracle.com/javase/6/docs/technotes-/guides/javadoc/doclet/overview.html Table1:Top10methodsinvolvedincrashesMethods Exceptions dismiss IllegalArgumentException,NullPointerExceptionshow WindowsManager.BadTokenException,IllegalStateException,In ateExceptionsetContentView In ateExceptioncreateScaledBitmap IllegalArgumentException,NullPointerExceptiononKeyDown IllegalStateExceptionisPlaying IllegalStateExceptionunregisterReceiver IllegalArgumentExceptiononBackPressed IllegalStateExceptionshowDialog WindowManager.BadTokenExceptioncreate Resources.NotFoundExceptionexceptionssuchasOutOfMemoryErrorinthedocumentation.6.RELATEDWORKAlthoughtherearepracticalguidelinesforwell-writtenapis[1,6],thereisstillgroundforempiricalstudiesthatdistinguishgoodfrombadapiparadigms.Currentstudiesfocusonapilearnability[9,8].Here,wearguedaboutexcep-tionsthatcouldhavebeenincludedinthedocumentationofapimethods.Acrashreportcanincludeastacktraceandmetadata:applicationname,operatingsystem,dateandtimeofthecrash.Thesedataprovidevaluableinformationforcrashcauseunderstandingandsoftwarereliability.Ganapathietal.[4]analyzedcrashreportsfromtheWindowsxpkernelandidentifybasiccrashcausetypes.Kimetal.[7]conductedanempiricalinvestigationontheFirefoxandThunderbirdcrashreportdatabasestopredict\topcrashes"fornewsoftwarereleases.Inaddition,stacktracesareusefulfortheminingandqualityevaluationofcrashreports[10,2],aswellasforbuglocalization[11].Contrarytotheexistingworks,weanalyzedstacktracesfromcrashreportsandidenti edAndroidapimethodswithundocumentedexceptions.7.CONCLUSIONSWeanalyzedstacktracesfromAndroidapplicationcrashestoidentifymethodsfromtheAndroidapithathavemissingdocumentationconcerningexceptionalcases.Wefoundthat18%ofnon-privatemethodsintheAndroidapihadundoc-umentedexceptions.Fromthemethodswithdocumentedexceptions,56%werecheckedand44%unchecked.Also,wefoundthat69%ofthemethods|fromAndroidpackages|inourstacktraceshadundocumentedexceptionsintheAn-droidapi.Then,19%ofourcrashescouldhavebeencausedbyinsucientdocumentation.8.ACKNOWLEDGMENTSWewouldliketothankBugSense(whichisnowaSplunkcompany),andmorespeci callyitsfoundersPanosPa-padopoulosandJohnVlachogiannisforthedataandin-formationtheyprovidedus.Inaddition,wewouldliketothankDimitrisMitropoulosforhisideasandinternalreviews.Thisresearchhasbeenco- nancedbytheEuropeanUnion(EuropeanSocialFund|esf)andGreeknationalfundsthroughtheOperationalProgram\EducationandLifelongLearning"oftheNationalStrategicReferenceFramework(nsrf)|ResearchFundingProgram:Thalis|AthensUni-versityofEconomicsandBusiness|SoftwareEngineeringResearchPlatform.9.REFERENCES[1]J.Bloch.HowtodesignagoodAPIandwhyitmatters.InCompaniontothe21stACMSIGPLANsymposiumonObject{OrientedProgrammingSystems,Languages,andApplications,OOPSLA'06,pages506{507,NewYork,NY,USA,2006.ACM.[2]Y.Dang,R.Wu,H.Zhang,D.Zhang,andP.Nobel.ReBucket:amethodforclusteringduplicatecrashreportsbasedoncallstacksimilarity.InProceedingsofthe2012InternationalConferenceonSoftwareEngineering,ICSE2012,pages1084{1093,Piscataway,NJ,USA,2012.IEEEPress.[3]J.E.ForresterandB.P.Miller.AnempiricalstudyoftherobustnessofwindowsNTapplicationsusingrandomtesting.InProceedingsofthe4thUSENIXWindowsSystemSymposium,pages59{68,2000.[4]A.Ganapathi,V.Ganapathi,andD.A.Patterson.WindowsXPkernelcrashanalysis.InLISA,volume6,pages49{159,2006.[5]S.Gar nkel,D.Weise,andS.Strassmann,editors.TheUNIXHater'sHandbook.IDGBooksWorldwide,Inc.,SanMateo,CA,USA,1994.[6]M.Henning.APIdesignmatters.Commun.ACM,52(5):46{56,May2009.[7]D.Kim,X.Wang,S.Kim,A.Zeller,S.Cheung,andS.Park.WhichcrashesshouldI x rst?:Predictingtopcrashesatanearlystagetoprioritizedebugginge orts.SoftwareEngineering,IEEETransactionson,37(3):430{447,2011.[8]W.MaalejandM.P.Robillard.PatternsofknowledgeinAPIreferencedocumentation.IEEETransactionsonSoftwareEngineering,99(PrePrints):1,2013.[9]M.RobillardandR.DeLine.A eldstudyofAPIlearningobstacles.EmpiricalSoftwareEngineering,16(6):703{732,2011.[10]A.Schroter,N.Bettenburg,andR.Premraj.Dostacktraceshelpdevelopers xbugs?InMiningSoftwareRepositories(MSR),20107thIEEEWorkingConferenceon,pages118{121,May2010.[11]S.Wang,F.Khomh,andY.Zou.Improvingbuglocalizationusingcorrelationsincrashreports.InProceedingsoftheTenthInternationalWorkshoponMiningSoftwareRepositories,MSR'13,pages247{256,Piscataway,NJ,USA,2013.IEEEPress.

Related Contents


Next Show more