To Type or Not to Type: Quantifying Detectable Bugs in Java']JavaScript

被引:52
|
作者
Gao, Zheng [1 ]
Bird, Christian [2 ]
Barr, Earl T. [1 ]
机构
[1] UCL, London, England
[2] Microsoft Res, Redmond, WA USA
基金
英国工程与自然科学研究理事会;
关键词
!text type='Java']Java[!/text]Script; static type systems; Flow; TypeScript; mining software repositories; STATIC TYPE SYSTEMS; AGREEMENT;
D O I
10.1109/ICSE.2017.75
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
JavaScript is growing explosively and is now used in large mature projects even outside the web domain. JavaScript is also a dynamically typed language for which static type systems, notably Facebook's Flow and Microsoft's TypeScript, have been written. What benefits do these static type systems provide? Leveraging JavaScript project histories, we select a fixed bug and check out the code just prior to the fix. We manually add type annotations to the buggy code and test whether Flow and TypeScript report an error on the buggy code, thereby possibly prompting a developer to fix the bug before its public release. We then report the proportion of bugs on which these type systems reported an error. Evaluating static type systems against public bugs, which have survived testing and review, is conservative: it understates their effectiveness at detecting bugs during private development, not to mention their other benefits such as facilitating code search/completion and serving as documentation. Despite this uneven playing field, our central finding is that both static type systems find an important percentage of public bugs: both Flow 0.30 and TypeScript 2.0 successfully detect 15%!
引用
收藏
页码:758 / 769
页数:12
相关论文
共 50 条
  • [1] Type Analysis for Java']JavaScript
    Jensen, Simon Holm
    Moller, Anders
    Thiemann, Peter
    [J]. STATIC ANALYSIS, 2009, 5673 : 238 - +
  • [2] Type Checking for Java']JavaScript
    Anderson, Christopher
    Giannini, Paola
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2005, 138 (02) : 37 - 58
  • [3] Towards type inference for Java']JavaScript
    Anderson, C
    Giannini, P
    Drossopoulou, S
    [J]. ECOOP 2005 - OBJECT-ORIENTED PROGRAMMING, PROCEEDINGS, 2005, 3586 : 428 - 452
  • [4] An empirical study on bugs in Java']JavaScript engines
    Wang, Ziyuan
    Bu, Dexin
    Wang, Nannan
    Yu, Sijie
    Gou, Shanyi
    Sun, Aiyue
    [J]. INFORMATION AND SOFTWARE TECHNOLOGY, 2023, 155
  • [5] BUGSJS']JS: A Benchmark of Java']JavaScript Bugs
    Gyimesi, Peter
    Vancsics, Bela
    Stocco, Andrea
    Mazinanian, Davood
    Beszedes, Arpad
    Ferenc, Rudolf
    Mesbah, Ali
    [J]. 2019 IEEE 12TH CONFERENCE ON SOFTWARE TESTING, VALIDATION AND VERIFICATION (ICST 2019), 2019, : 90 - 101
  • [6] 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
  • [7] Mining API Type Specifications for Java']JavaScript
    Wang, Shuai
    Dou, Wensheng
    Gao, Chushu
    Wei, Jun
    Huang, Tao
    [J]. 2017 24TH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE (APSEC 2017), 2017, : 368 - 377
  • [8] Type Refinement for Static Analysis of Java']JavaScript
    Kashyap, Vineeth
    Sarracino, John
    Wagner, John
    Wiedermann, Ben
    Hardekopf, Ben
    [J]. ACM SIGPLAN NOTICES, 2014, 49 (02) : 17 - 26
  • [9] Type Inference for Static Compilation of Java']JavaScript
    Chandra, Satish
    Gordon, Colin S.
    Jeannin, Jean-Baptiste
    Schlesinger, Cole
    Sridharan, Manu
    Tip, Frank
    Choi, Youngil
    [J]. ACM SIGPLAN NOTICES, 2016, 51 (10) : 410 - 429
  • [10] TeJaS: Retrofitting Type Systems for Java']JavaScript
    Lerner, Benjamin S.
    Politz, Joe Gibbs
    Guha, Arjun
    Krishnamurthi, Shriram
    [J]. ACM SIGPLAN NOTICES, 2014, 49 (02) : 1 - 15