TypeDevil: Dynamic Type Inconsistency Analysis for Java']JavaScript

被引:52
作者
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
来源
2015 IEEE/ACM 37TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, VOL 1 | 2015年
关键词
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
相关论文
共 45 条
[1]  
Ahn W, 2014, ACM SIGPLAN NOTICES, V49, P496, DOI [10.1145/2666356.2594332, 10.1145/2594291.2594332]
[2]   Dynamic Inference of Static Types for Ruby [J].
An, Jong-hoon ;
Chaudhuri, Avik ;
Foster, Jeffrey S. ;
Hicks, Michael .
POPL 11: PROCEEDINGS OF THE 38TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2011, :459-471
[3]  
Ancona Davide, 2007, Proceedings of the 2007 Symposium on Dynamic Languages, DLS'07, DOI [DOI 10.1145/1297081.1297091, 10.1145/1297081.1297091]
[4]  
[Anonymous], 979711999 ISOIEC
[5]  
[Anonymous], 2011, ECMAScript Language Specification Edition 5.1, V5.1
[6]  
Artzi S, 2011, 2011 33RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), P571, DOI 10.1145/1985793.1985871
[7]  
Austin Thomas H., 2009, P ACM SIGPLAN 4 WORK, P113, DOI DOI 10.1145/1554339.1554353
[8]  
AYCOCK J, 2000, INT PYTH C
[9]  
Bierman G, 2014, LECT NOTES COMPUT SC, V8586, P257
[10]   Staged Information Flow for Java']JavaScript [J].
Chugh, Ravi ;
Meister, Jeffrey A. ;
Jhala, Ranjit ;
Lerner, Sorin .
PLDI'09 PROCEEDINGS OF THE 2009 ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION, 2009, :50-62