Finding Broken Promises in Asynchronous Java']JavaScript Programs

被引:8
|
作者
Alimadadi, Saba [1 ]
Zhong, Di [1 ]
Madsen, Magnus [2 ]
Tip, Frank [1 ]
机构
[1] Northeastern Univ, Boston, MA 02115 USA
[2] Aarhus Univ, Aarhus, Denmark
基金
加拿大自然科学与工程研究理事会;
关键词
!text type='Java']Java[!/text]Script; Promises; Promise Graph; Dynamic Analysis; PromiseKeeper;
D O I
10.1145/3276532
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Recently, promises were added to ECMAScript 6, the JavaScript standard, in order to provide better support for the asynchrony that arises in user interfaces, network communication, and non-blocking I/O. Using promises, programmers can avoid common pitfalls of event-driven programming such as event races and the deeply nested counterintuitive control flow referred to as lcallback hellz. Unfortunately, promises have complex semantics and the intricate controls and data-flow present in promise-based code hinders program comprehension and can easily lead to bugs. The promise graph was proposed as a graphical aid for understanding and debugging promise-based code. However, it did not cover all promise-related features in ECMAScript 6, and did not present or evaluate any technique for constructing the promise graphs. In this paper, we extend the notion of promise graphs to include all promise-related features in ECMAScript 6, including default reactions, exceptions, and the synchronization operations race and all. Furthermore, we report on the construction and evaluation of PromiseKeeper, which performs a dynamic analysis to create promise graphs and infer common promise anti-patterns. We evaluate PromiseKeeper by applying it to 12 open source promise-based Node.js applications. Our results suggest that the promise graphs constructed by PromiseKeeper can provide developers with valuable information about occurrences of common anti-patterns in their promise-based code, and that promise graphs can be constructed with acceptable run-time overhead.
引用
收藏
页数:26
相关论文
共 50 条
  • [1] Semantics of Asynchronous Java']JavaScript
    Loring, Matthew C.
    Marron, Mark
    Leijen, Daan
    [J]. ACM SIGPLAN NOTICES, 2017, 52 (11) : 51 - 62
  • [2] Ajax: Asynchronous Java']JavaScript and XML
    Bruno, EJ
    [J]. DR DOBBS JOURNAL, 2006, 31 (02): : 32 - 35
  • [3] An Asynchronous Call Graph for Java']JavaScript
    Seifert, Dominik
    Wan, Michael
    Hsu, Jane
    Yeh, Benson
    [J]. 2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: SOFTWARE ENGINEERING IN PRACTICE (ICSE-SEIP 2022), 2022, : 29 - 30
  • [4] Broken Promises: An Empirical Study into Evolution Problems in Java']Java Programs Caused by Library Upgrades
    Dietrich, Jens
    Jezek, Kamil
    Brada, Premek
    [J]. 2014 SOFTWARE EVOLUTION WEEK - IEEE CONFERENCE ON SOFTWARE MAINTENANCE, REENGINEERING, AND REVERSE ENGINEERING (CSMR-WCRE), 2014, : 64 - +
  • [5] Typing and semantics of asynchronous arrows in Java']JavaScript
    Fritz, Eric
    Zhao, Tian
    [J]. SCIENCE OF COMPUTER PROGRAMMING, 2017, 141 : 1 - 39
  • [6] Converting Physlets and Other Java']Java Programs to Java']JavaScript
    Christian, Wolfgang
    Belloni, Mario
    Hanson, Robert M.
    Mason, Bruce
    Barbato, Lyle
    [J]. PHYSICS TEACHER, 2021, 59 (04): : 278 - 281
  • [7] Towards Specializing Java']JavaScript Programs
    Thiemann, Peter
    [J]. PERSPECTIVES OF SYSTEM INFORMATICS, PSI 2014, 2015, 8974 : 320 - 334
  • [8] Finding and Preventing Bugs in Java']JavaScript Bindings
    Brown, Fraser
    Narayan, Shravan
    Wahby, Riad S.
    Engler, Dawson
    Jhala, Ranjit
    Stefan, Deian
    [J]. 2017 IEEE SYMPOSIUM ON SECURITY AND PRIVACY (SP), 2017, : 559 - 578
  • [9] AUGUR: Dynamic Taint Analysis for Asynchronous Java']JavaScript
    Aldrich, Mark W.
    Turcotte, Alexi
    Blanco, Matthew
    Tip, Frank
    [J]. PROCEEDINGS OF THE 37TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2022, 2022,
  • [10] An Analysis of the Dynamic Behavior of Java']JavaScript Programs
    Richards, Gregor
    Lebresne, Sylvain
    Burg, Brian
    Vitek, Jan
    [J]. ACM SIGPLAN NOTICES, 2010, 45 (06) : 1 - 12