An Asynchronous Call Graph for JavaScript
Thu 12 May 2022 04:10 - 04:15 at ICSE room 5-even hours - Programming Languages 1 Chair(s): Jean-Guy Schneider
Asynchronous JavaScript has become omnipresent, yet is inherently difficult to reason about. While many recent debugging tools are trying to address this issue with (semi-)automatic methods, interactive analysis tools are few and far between. To this date, developers are required to build mental models of complex concurrent control flows with little to no tool support. Thus, asynchrony is making life hard for novices and catches even seasoned developers off-guard, especially when dealing with unfamiliar code. That is why we propose the Asynchronous Call Graph. It is the first approach to capture and visualize concurrent control flow, as well as synchronization between multiple concurrent control flows in a call graph. It is also the first concurrency analysis tool for JavaScript that is fully interactive and integrated with an omniscient debugger in a popular IDE. First tests show that the ACG deals well with all three types of JS asynchronous events. It reveals hidden patterns when applied to classical problems of concurrent computing, as well as eleven popular real-world projects. Moreover, the ACG assisted us in finding a new bug in the sequelize ORM library. This tool has the potential to set a new standard for how developers can analyze asynchrony, not only in JavaScript but any of the languages observing similar asynchronous semantics.