DrAsync: Identifying and Visualizing Anti-Patterns in Asynchronous JavaScript
Alexi Turcotte, Michael D. Shah, Mark W. Aldrich, Frank Tip
摘要
Promises and async/await have become popular mechanisms for implementing asynchronous computations in JavaScript, but despite their popularity, programmers have difficulty using them. This paper identifies 8 anti-patterns in promise-based JavaScript code that are prevalent across popular JavaScript repositories. We present a light-weight static analysis for automatically detecting these anti-patterns. This analysis is embedded in an interactive visualization tool that additionally relies on dynamic analysis to visualize promise lifetimes and instances of anti-patterns executed at run time. By enabling the user to navigate between promises in the visualization and the source code fragments that they originate from, problems and optimization opportunities can be identified. We implement this approach in a tool called DrAsync, and found 2.6K static instances of anti-patterns in 20 popular JavaScript repositories. Upon examination of a subset of these, we found that the majority of problematic code reported by DrAsync could be eliminated through refactoring. Further investigation revealed that, in a few cases, the elimination of anti-patterns reduced the time needed to execute the refactored code fragments. Moreover, DrAsync's visualization of promise lifetimes and relationships provides additional insight into the execution behavior of asynchronous programs and helped identify further optimization opportunities.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper2
- Code Coverage Criteria for Asynchronous ProgramsMohammad Ganji, Saba Alimadadi, Frank TipFSE 2023 · 被引用 3 次
- Preserving Reactiveness: Understanding and Improving the Debugging Practice of Blocking-Call BugsArooba Shahoor, Jooyong Yi, Dongsun KimISSTA 2024 · 被引用 1 次
它引用的顶会 Paper1
相关 Paper
- Detecting locations in JavaScript programs affected by breaking library changesAnders Møller, Benjamin Barslev Nielsen, Martin Toldam TorpOOPSLA 2020 · 被引用 32 次
- Static asynchronous component misuse detection for Android applicationsLinjie Pan, Baoquan Cui, Hao Liu, Jiwei Yan 等FSE 2020 · 被引用 10 次
- Increasing the Responsiveness of Web Applications by Introducing Lazy LoadingAlexi Turcotte, Satyajit Gokhale, Frank TipASE 2023 · 被引用 3 次
- Semantic Patches for Adaptation of JavaScript Programs to Evolving LibrariesBenjamin Barslev Nielsen, Martin Toldam Torp, Anders MøllerICSE 2021 · 被引用 17 次
- DyLin: A Dynamic Linter for PythonAryaz Eghbali, Felix Burk, Michael PradelFSE 2025 · 被引用 1 次
