Lune

ICSE2022顶会

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Preserving Reactiveness: Understanding and Improving the Debugging Practice of Blocking-Call Bugs 引用了 Automatic migration from synchronous to asynchronous JavaScript APIs
  • Code Coverage Criteria for Asynchronous Programs 引用了 Automatic migration from synchronous to asynchronous JavaScript APIs
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper2

  1. Code Coverage Criteria for Asynchronous ProgramsMohammad Ganji, Saba Alimadadi, Frank TipFSE 2023 · 3 次引用
  2. Preserving Reactiveness: Understanding and Improving the Debugging Practice of Blocking-Call BugsArooba Shahoor, Jooyong Yi, Dongsun KimISSTA 2024 · 1 次引用

它引用的 Paper1

  1. Automatic migration from synchronous to asynchronous JavaScript APIsSatyajit Gokhale, Alexi Turcotte, Frank TipOOPSLA 2021 · 23 次引用

相关 Paper

  1. Detecting locations in JavaScript programs affected by breaking library changesAnders Møller, Benjamin Barslev Nielsen, Martin Toldam TorpOOPSLA 2020 · 32 次引用
  2. Static asynchronous component misuse detection for Android applicationsLinjie Pan, Baoquan Cui, Hao Liu, Jiwei Yan 等FSE 2020 · 10 次引用
  3. Increasing the Responsiveness of Web Applications by Introducing Lazy LoadingAlexi Turcotte, Satyajit Gokhale, Frank TipASE 2023 · 3 次引用
  4. Semantic Patches for Adaptation of JavaScript Programs to Evolving LibrariesBenjamin Barslev Nielsen, Martin Toldam Torp, Anders MøllerICSE 2021 · 17 次引用
  5. DyLin: A Dynamic Linter for PythonAryaz Eghbali, Felix Burk, Michael PradelFSE 2025 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖