资源描述:
《Modeling the HTML DOM and Browser API in Static Analysis of JavaScript Web Applications》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、ModelingtheHTMLDOMandBrowserAPIinStaticAnalysisofJavaScriptWebApplications∗SimonHolmJensenMagnusMadsen*AndersMøller*AarhusUniversityAarhusUniversityAarhusUniversitysimonhj@cs.au.dkmagnusm@cs.au.dkamoeller@cs.au.dkABSTRACT1.INTRODUCTIONDevelopersofJavaSc
2、riptwebapplicationshavelittletoolAJavaScriptwebapplicationisinessenceanHTMLpagesupportforcatchingerrorsearlyindevelopment.Incom-withJavaScriptcodeandotherresources,suchasCSSstyle-parison,anabundanceoftoolsexistforstaticallytypedsheetsandimagefiles.Progra
3、mexecutionisdrivenbylanguages,includingsophisticatedintegrateddevelopmenteventsintheuser’sbrowser:thepageisinitiallyloaded,theenvironmentsandspecializedstaticanalyses.Transferringuserinteractswiththemouseandkeyboard,timeoutsoccur,suchtechnologiestothedo
4、mainofJavaScriptwebappli-AJAXresponsemessagesarereceivedfromtheserver,etc.cationsischallenging.Inthispaper,wediscussthechal-Theeventhandlercodereactsbymodifyingtheprogramlenges,whichincludethedynamicaspectsofJavaScriptandstateandtheHTMLpageviaitsDOM(Doc
5、umentObjectthecomplexinteractionsbetweenJavaScript,HTML,andModel)andbyinteractingwiththebrowserAPI,forexam-thebrowser.Fromthis,wepresentthefirststaticanalysispletoregisterneweventhandlers.Comparedtoothersoft-thatiscapableofreasoningabouttheflowofcontrolan
6、dwareplatforms,thestateoftheartindevelopmentofsuchdatainmodernJavaScriptapplicationsthatinteractwithwebapplicationsisratherprimitive,whichmakesitdifficulttheHTMLDOMandbrowserAPI.towriteandmaintainrobustapplications.StaticallytypedOneapplicationofsuchastat
7、icanalysisistodetecttype-languages,suchasJavaandC#,havelongbenefitedfromrelatedanddataflow-relatedprogrammingerrors.WereportadvancedIDEsandstaticanalysistechniqueswithrichcapa-onexperimentswitharangeofmodernwebapplications,bilitiesoflocatinglikelyprogramm
8、ingerrorsduringdevelop-includingChromeExperimentsandIETestDriveapplica-ment.ExamplesofsuchtoolsincludeEclipse,VisualStudio,tions,tomeasuretheprecisionandperformanceofthetech-FindBugs,andKlocwork.Incontrast,existingtoolsupportniqu