Practical Analysis of the Dynamic Characteristics of JavaScript

JavaScript is a dynamic object-oriented programming language, which is designed with flexible programming mechanisms. JavaScript is widely used in developing sophisticated software systems, especially web applications. Despite of its popularity, there is a lack of software tools that support JavaScr...

Full description

Bibliographic Details
Main Author: Wei, Shiyi
Other Authors: Computer Science
Format: Others
Published: Virginia Tech 2015
Subjects:
Online Access:http://hdl.handle.net/10919/56697
id ndltd-VTETD-oai-vtechworks.lib.vt.edu-10919-56697
record_format oai_dc
spelling ndltd-VTETD-oai-vtechworks.lib.vt.edu-10919-566972021-12-17T06:11:56Z Practical Analysis of the Dynamic Characteristics of JavaScript Wei, Shiyi Computer Science Ryder, Barbara G. Hendren, Laurie J. Kafura, Dennis G. Yao, Danfeng (Daphne) Tilevich, Eli Dataflow Analysis JavaScript Context Sensitivity JavaScript is a dynamic object-oriented programming language, which is designed with flexible programming mechanisms. JavaScript is widely used in developing sophisticated software systems, especially web applications. Despite of its popularity, there is a lack of software tools that support JavaScript for software engineering clients. Dataflow analysis approximates software behavior by analyzing the program code; it is the foundation for many software tools. However, several unique features of JavaScript render existing dataflow analysis techniques ineffective. Reflective constructs, generating code at runtime, make it difficult to acquire the complete program at compile time. Dynamic typing, resulting in changes in object behavior, poses a challenge for building accurate models of objects. Different functionalities can be observed when a function is variadic; the variance of the function behavior may be caused by the arguments whose values can only be known at runtime. Object constructors may be polymorphic such that objects created by the same constructor may contain different properties. In addition to object-oriented programming, JavaScript supports paradigms of functional and procedural programming; this feature renders dataflow analysis techniques ineffective when a JavaScript application uses multiple paradigms. Dataflow analysis needs to handle these challenges. In this work, we present an analysis framework and several dataflow analyses that can handle dynamic features in JavaScript. The first contribution of our work is the design and instantiation of the JavaScript Blended Analysis Framework (JSBAF). This general-purpose and flexible framework judiciously combines dynamic and static analyses. We have implemented an instance of JSBAF, blended taint analysis, to demonstrate the practicality of the framework. Our second contribution is an novel context-sensitive points-to analysis for JavaScript that accurately models object property changes. This algorithm uses a new program representation that enables partial flow-sensitive analysis, a more accurate object representation, and an expanded points-to graph. We have defined parameterized state sensitivity (i.e., k-state sensitivity) and evaluated the effectiveness of 1-state-sensitive analysis as the static phase of JSBAF. The third contribution of our work is an adaptive context-sensitive analysis that selectively applies context-sensitive analysis on the function level. This two-staged adaptive analysis extracts function characteristics from an inexpensive points-to analysis and uses learning-based heuristics to decide on an appropriate context-sensitive analysis per function. The experimental results show that the adaptive analysis is more precise than any single context-sensitive analysis for several programs in the benchmarks, especially for those multi-paradigm programs. Ph. D. 2015-10-06T08:01:12Z 2015-10-06T08:01:12Z 2015-10-05 Dissertation vt_gsexam:6355 http://hdl.handle.net/10919/56697 In Copyright http://rightsstatements.org/vocab/InC/1.0/ ETD application/pdf Virginia Tech
collection NDLTD
format Others
sources NDLTD
topic Dataflow Analysis
JavaScript
Context Sensitivity
spellingShingle Dataflow Analysis
JavaScript
Context Sensitivity
Wei, Shiyi
Practical Analysis of the Dynamic Characteristics of JavaScript
description JavaScript is a dynamic object-oriented programming language, which is designed with flexible programming mechanisms. JavaScript is widely used in developing sophisticated software systems, especially web applications. Despite of its popularity, there is a lack of software tools that support JavaScript for software engineering clients. Dataflow analysis approximates software behavior by analyzing the program code; it is the foundation for many software tools. However, several unique features of JavaScript render existing dataflow analysis techniques ineffective. Reflective constructs, generating code at runtime, make it difficult to acquire the complete program at compile time. Dynamic typing, resulting in changes in object behavior, poses a challenge for building accurate models of objects. Different functionalities can be observed when a function is variadic; the variance of the function behavior may be caused by the arguments whose values can only be known at runtime. Object constructors may be polymorphic such that objects created by the same constructor may contain different properties. In addition to object-oriented programming, JavaScript supports paradigms of functional and procedural programming; this feature renders dataflow analysis techniques ineffective when a JavaScript application uses multiple paradigms. Dataflow analysis needs to handle these challenges. In this work, we present an analysis framework and several dataflow analyses that can handle dynamic features in JavaScript. The first contribution of our work is the design and instantiation of the JavaScript Blended Analysis Framework (JSBAF). This general-purpose and flexible framework judiciously combines dynamic and static analyses. We have implemented an instance of JSBAF, blended taint analysis, to demonstrate the practicality of the framework. Our second contribution is an novel context-sensitive points-to analysis for JavaScript that accurately models object property changes. This algorithm uses a new program representation that enables partial flow-sensitive analysis, a more accurate object representation, and an expanded points-to graph. We have defined parameterized state sensitivity (i.e., k-state sensitivity) and evaluated the effectiveness of 1-state-sensitive analysis as the static phase of JSBAF. The third contribution of our work is an adaptive context-sensitive analysis that selectively applies context-sensitive analysis on the function level. This two-staged adaptive analysis extracts function characteristics from an inexpensive points-to analysis and uses learning-based heuristics to decide on an appropriate context-sensitive analysis per function. The experimental results show that the adaptive analysis is more precise than any single context-sensitive analysis for several programs in the benchmarks, especially for those multi-paradigm programs. === Ph. D.
author2 Computer Science
author_facet Computer Science
Wei, Shiyi
author Wei, Shiyi
author_sort Wei, Shiyi
title Practical Analysis of the Dynamic Characteristics of JavaScript
title_short Practical Analysis of the Dynamic Characteristics of JavaScript
title_full Practical Analysis of the Dynamic Characteristics of JavaScript
title_fullStr Practical Analysis of the Dynamic Characteristics of JavaScript
title_full_unstemmed Practical Analysis of the Dynamic Characteristics of JavaScript
title_sort practical analysis of the dynamic characteristics of javascript
publisher Virginia Tech
publishDate 2015
url http://hdl.handle.net/10919/56697
work_keys_str_mv AT weishiyi practicalanalysisofthedynamiccharacteristicsofjavascript
_version_ 1723964907129405440