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

被引:58
作者
Gao, Zheng [1 ]
Bird, Christian [2 ]
Barr, Earl T. [1 ]
机构
[1] UCL, London, England
[2] Microsoft Res, Redmond, WA USA
来源
2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE) | 2017年
基金
英国工程与自然科学研究理事会;
关键词
!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
相关论文
共 53 条
[1]   DYNAMIC TYPING IN A STATICALLY TYPED LANGUAGE [J].
ABADI, M ;
CARDELLI, L ;
PIERCE, B ;
PLOTKIN, G .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 1991, 13 (02) :237-268
[2]  
[Anonymous], 2015, JAVASCRIPT EQUALITY
[3]  
[Anonymous], 2010, P FAST SOFTW ENCR WO
[4]  
[Anonymous], 2002, Types and Programming Languages
[5]  
[Anonymous], 2012, P ACM SIGSOFT 20 INT
[6]   Evaluating the Cost Reduction of Static Code Analysis for Software Security [J].
Baca, Dejan ;
Carlsson, Bengt ;
Lundberg, Lars .
PLAS'08: PROCEEDINGS OF THE ACM SIGPLAN THIRD WORKSHOP ON PROGRAMMING LANGUAGES AND ANALYSIS FOR SECURITY, 2008, :79-88
[7]  
Brun Y., 2011, 19 ACM SIGSOFT S 13, P168, DOI DOI 10.1145/2025113.2025139
[8]   Type systems [J].
Cardelli, L .
ACM COMPUTING SURVEYS, 1996, 28 (01) :263-264
[9]   A COEFFICIENT OF AGREEMENT FOR NOMINAL SCALES [J].
COHEN, J .
EDUCATIONAL AND PSYCHOLOGICAL MEASUREMENT, 1960, 20 (01) :37-46
[10]  
Daly M. T., 2009, WORK PROGR EMPIRICAL