Static Analysis for Asynchronous JavaScript Programs

01/11/2019
by   Thodoris Sotiropoulos, et al.
0

Asynchrony has become an inherent element of JavaScript, as an effort to improve the scalability and performance of modern web applications. To this end, JavaScript provides programmers with a wide range of constructs and features for developing code that performs asynchronous computations, including but not limited to timers, promises, and non-blocking I/O. However, the data flow imposed by asynchrony is implicit, and not always well-understood by the developers who introduce many asynchrony-related bugs to their programs. Worse, there are few tools and techniques available for analyzing and reasoning about such asynchronous applications. In this work, we address this issue by designing and implementing one of the first static analysis schemes capable of dealing with almost all the asynchronous primitives of JavaScript up to the 7th edition of the ECMAScript specification. Specifically, we introduce the callback graph, a representation for capturing data flow between asynchronous code. We exploit the callback graph for designing a more precise analysis that respects the execution order between different asynchronous functions. We parameterize our analysis with one novel context-sensitivity flavor, and we end up with multiple analysis variations for building callback graph. We performed a number of experiments on a set of hand-written and real-world JavaScript programs. Our results show that our analysis can be applied to medium-sized programs achieving 79 suggest that analysis sensitivity is beneficial for the vast majority of the benchmarks. Specifically, it is able to improve precision by up to 28.5 it achieves an 88

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/15/2018

Debugging Static Analysis

To detect and fix bugs and security vulnerabilities, software companies ...
research
05/04/2023

A Study of Static Warning Cascading Tools (Experience Paper)

Static analysis is widely used for software assurance. However, static a...
research
09/14/2022

Automated Synthesis of Asynchronizations

Asynchronous programming is widely adopted for building responsive and e...
research
08/01/2023

The Hitchhiker's Guide to Program Analysis: A Journey with Large Language Models

Static analysis is a widely used technique in software engineering for i...
research
01/21/2021

General Decidability Results for Asynchronous Shared-Memory Programs: Higher-Order and Beyond

The model of asynchronous programming arises in many contexts, from low-...
research
05/20/2015

Asynchronous Multi-Context Systems

In this work, we present asynchronous multi-context systems (aMCSs), whi...
research
08/09/2018

Safe Stream-Based Programming with Refinement Types

In stream-based programming, data sources are abstracted as a stream of ...

Please sign up or login with your details

Forgot password? Click here to reset