Modeling the HTML DOM and browser API in static analysis of JavaScript web applications

S. Jensen, Magnus Madsen, Anders Møller
{"title":"Modeling the HTML DOM and browser API in static analysis of JavaScript web applications","authors":"S. Jensen, Magnus Madsen, Anders Møller","doi":"10.1145/2025113.2025125","DOIUrl":null,"url":null,"abstract":"Developers of JavaScript web applications have little tool support for catching errors early in development. In comparison, an abundance of tools exist for statically typed languages, including sophisticated integrated development environments and specialized static analyses. Transferring such technologies to the domain of JavaScript web applications is challenging. In this paper, we discuss the challenges, which include the dynamic aspects of JavaScript and the complex interactions between JavaScript, HTML, and the browser. From this, we present the first static analysis that is capable of reasoning about the flow of control and data in modern JavaScript applications that interact with the HTML DOM and browser API.\n One application of such a static analysis is to detect type-related and dataflow-related programming errors. We report on experiments with a range of modern web applications, including Chrome Experiments and IE Test Drive applications, to measure the precision and performance of the technique. The experiments indicate that the analysis is able to show absence of errors related to missing object properties and to identify dead and unreachable code. By measuring the precision of the types inferred for object properties, the analysis is precise enough to show that most expressions have unique types. By also producing precise call graphs, the analysis additionally shows that most invocations in the programs are monomorphic. We furthermore study the usefulness of the analysis to detect spelling errors in the code. Despite the encouraging results, not all problems are solved and some of the experiments indicate a potential for improvement, which allows us to identify central remaining challenges and outline directions for future work.","PeriodicalId":184518,"journal":{"name":"ESEC/FSE '11","volume":"14 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2011-09-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"119","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"ESEC/FSE '11","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2025113.2025125","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 119

Abstract

Developers of JavaScript web applications have little tool support for catching errors early in development. In comparison, an abundance of tools exist for statically typed languages, including sophisticated integrated development environments and specialized static analyses. Transferring such technologies to the domain of JavaScript web applications is challenging. In this paper, we discuss the challenges, which include the dynamic aspects of JavaScript and the complex interactions between JavaScript, HTML, and the browser. From this, we present the first static analysis that is capable of reasoning about the flow of control and data in modern JavaScript applications that interact with the HTML DOM and browser API. One application of such a static analysis is to detect type-related and dataflow-related programming errors. We report on experiments with a range of modern web applications, including Chrome Experiments and IE Test Drive applications, to measure the precision and performance of the technique. The experiments indicate that the analysis is able to show absence of errors related to missing object properties and to identify dead and unreachable code. By measuring the precision of the types inferred for object properties, the analysis is precise enough to show that most expressions have unique types. By also producing precise call graphs, the analysis additionally shows that most invocations in the programs are monomorphic. We furthermore study the usefulness of the analysis to detect spelling errors in the code. Despite the encouraging results, not all problems are solved and some of the experiments indicate a potential for improvement, which allows us to identify central remaining challenges and outline directions for future work.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
在JavaScript web应用程序的静态分析中对HTML DOM和浏览器API进行建模
JavaScript web应用程序的开发人员很少有工具支持在开发早期捕获错误。相比之下,针对静态类型语言存在大量的工具,包括复杂的集成开发环境和专门的静态分析。将这些技术转移到JavaScript web应用程序领域是具有挑战性的。在本文中,我们讨论了挑战,包括JavaScript的动态方面以及JavaScript、HTML和浏览器之间复杂的交互。由此,我们提出了第一个静态分析,它能够推理出与HTML DOM和浏览器API交互的现代JavaScript应用程序中的控制流和数据流。这种静态分析的一个应用是检测与类型相关和与数据流相关的编程错误。我们报告了一系列现代web应用程序的实验,包括Chrome实验和IE测试驱动应用程序,以衡量该技术的精度和性能。实验表明,该分析能够显示缺少与对象属性相关的错误,并识别出死代码和不可达代码。通过测量为对象属性推断的类型的精度,分析足够精确,可以显示大多数表达式具有唯一的类型。通过生成精确的调用图,分析还表明程序中的大多数调用都是单态的。我们进一步研究了分析在检测代码中的拼写错误方面的有用性。尽管取得了令人鼓舞的结果,但并非所有问题都得到了解决,一些实验表明有改进的潜力,这使我们能够确定仍然存在的主要挑战并概述未来工作的方向。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Semistructured merge: rethinking merge in revision control systems The 4th international workshop on social software engineering (SSE'11) Don't touch my code!: examining the effects of ownership on software quality SCORE: a scalable concolic testing tool for reliable embedded software Modeling the HTML DOM and browser API in static analysis of JavaScript web applications
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1