TypeDevil: Dynamic Type Inconsistency Analysis for Java']JavaScript

被引:48
|
作者
Pradel, Michael [1 ,2 ]
Schuh, Parker [1 ]
Sen, Koushik [1 ]
机构
[1] Univ Calif Berkeley, Dept EECS, Berkeley, CA 94720 USA
[2] Tech Univ Darmstadt, Dept Comp Sci, Darmstadt, Germany
关键词
D O I
10.1109/ICSE.2015.51
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Dynamic languages, such as JavaScript, give programmers the freedom to ignore types, and enable them to write concise code in short time. Despite this freedom, many programs follow implicit type rules, for example, that a function has a particular signature or that a property has a particular type. Violations of such implicit type rules often correlate with problems in the program. This paper presents TypeDevil, a mostly dynamic analysis that warns developers about inconsistent types. The key idea is to assign a set of observed types to each variable, property, and function, to merge types based in their structure, and to warn developers about variables, properties, and functions that have inconsistent types. To deal with the pervasiveness of polymorphic behavior in real-world JavaScript programs, we present a set of techniques to remove spurious warnings and to merge related warnings. Applying TypeDevil to widely used benchmark suites and real-world web applications reveals 15 problematic type inconsistencies, including correctness problems, performance problems, and dangerous coding practices.
引用
下载
收藏
页码:314 / 324
页数:11
相关论文
共 50 条
  • [21] Dynamic code compression for Java']JavaScript engine
    Park, Hyukwoo
    Kim, Seonghyun
    Bae, Boram
    SOFTWARE-PRACTICE & EXPERIENCE, 2023, 53 (05): : 1196 - 1217
  • [22] To Type or Not to Type: Quantifying Detectable Bugs in Java']JavaScript
    Gao, Zheng
    Bird, Christian
    Barr, Earl T.
    2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2017, : 758 - 769
  • [23] Mining API Type Specifications for Java']JavaScript
    Wang, Shuai
    Dou, Wensheng
    Gao, Chushu
    Wei, Jun
    Huang, Tao
    2017 24TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2017), 2017, : 368 - 377
  • [24] TeJaS: Retrofitting Type Systems for Java']JavaScript
    Lerner, Benjamin S.
    Politz, Joe Gibbs
    Guha, Arjun
    Krishnamurthi, Shriram
    ACM SIGPLAN NOTICES, 2014, 49 (02) : 1 - 15
  • [25] Type Inference for Static Compilation of Java']JavaScript
    Chandra, Satish
    Gordon, Colin S.
    Jeannin, Jean-Baptiste
    Schlesinger, Cole
    Sridharan, Manu
    Tip, Frank
    Choi, Youngil
    ACM SIGPLAN NOTICES, 2016, 51 (10) : 410 - 429
  • [26] Industry Practice of Java']JavaScript Dynamic Analysis on WeChat Mini-Programs
    Liu, Yi
    Xie, Jinhui
    Yang, Jianbo
    Guo, Shiyu
    Deng, Yuetang
    Li, Shuqing
    Wu, Yechang
    Liu, Yepang
    2020 35TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE 2020), 2020, : 1189 - 1193
  • [27] Empirical study of the dynamic behavior of Java']JavaScript objects
    Wei, Shiyi
    Xhakaj, Franceska
    Ryder, Barbara G.
    SOFTWARE-PRACTICE & EXPERIENCE, 2016, 46 (07): : 867 - 889
  • [28] Designing with java']javascript: Creating dynamic web pages
    DeLoach, S
    TECHNICAL COMMUNICATION, 1999, 46 (03) : 400 - 403
  • [29] Constraint Programming for Dynamic Symbolic Execution of Java']JavaScript
    Amadini, Roberto
    Andrlon, Mak
    Gange, Graeme
    Schachte, Peter
    Sondergaard, Harald
    Stuckey, Peter J.
    INTEGRATION OF CONSTRAINT PROGRAMMING, ARTIFICIAL INTELLIGENCE, AND OPERATIONS RESEARCH, CPAIOR 2019, 2019, 11494 : 1 - 19
  • [30] Jivin' with (Java']Java and) Java']JavaScript
    Beck, CO
    45TH ANNUAL CONFERENCE ON IMAGINATION, INNOVATION AND COMMUNICATION, 1998, : 331 - 333