Type-Aware Concolic Testing of Java']JavaScript Programs

被引:11
|
作者
Dhok, Monika [1 ]
Ramanathan, Murali Krishna [1 ]
Sinha, Nishant [2 ]
机构
[1] Indian Inst Sci, Bengaluru, India
[2] IBM Res, New Delhi, India
关键词
Dynamic analysis; !text type='Java']Java[!/text]Script; Testing;
D O I
10.1145/2884781.2884859
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Conventional concolic testing has been used to provide high coverage of paths in statically typed languages. While it has also been applied in the context of JavaScript (JS) programs, we observe that applying concolic testing to dynamically-typed JS programs involves tackling unique problems to ensure scalability. In particular, a naive type-agnostic extension of concolic testing to JS programs causes generation of large number of inputs. Consequently, many executions operate on undefined values and repeatedly explore same paths resulting in redundant tests, thus diminishing the scalability of testing drastically. In this paper, we address this problem by proposing a simple yet effective approach that incorporates type-awareness intelligently in conventional concolic testing to reduce the number of generated inputs for JS programs. We extend our approach inter-procedurally by generating preconditions for each function that provide a summary of the relation between the variable types and paths. Employing the function preconditions when testing reduces the number of inputs generated even further. We implement our ideas and validate it on a number of open-source JS programs (and libraries). For a significant percentage (on average 50%) of the functions, we observe that type-aware concolic testing generates a minuscule percentage (less than 5%) of the inputs as compared to conventional concolic testing approach implemented on top of JALANGI. On average, this approach achieves over 97% of line coverage and over 94% of branch coverage for all the functions across all benchmarks. Moreover, the use of function preconditions reduces the number of inputs generated by 50%. We also demonstrate the use of function preconditions in automatically avoiding real crashes due to incorrectly typed objects.
引用
收藏
页码:168 / 179
页数:12
相关论文
共 50 条
  • [31] Finding Broken Promises in Asynchronous Java']JavaScript Programs
    Alimadadi, Saba
    Zhong, Di
    Madsen, Magnus
    Tip, Frank
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2
  • [32] Ahead-of-time compilation of Java']JavaScript programs
    Zhuykov, R.
    Sharygin, E.
    [J]. PROGRAMMING AND COMPUTER SOFTWARE, 2017, 43 (01) : 51 - 59
  • [33] Analysis of Java']JavaScript Programs: Challenges and Research Trends
    Sun, Kwangwon
    Ryu, Sukyoung
    [J]. ACM COMPUTING SURVEYS, 2017, 50 (04)
  • [34] Relationship-Aware Code Search for Java']JavaScript Frameworks
    Li, Xuan
    Wang, Zerui
    Wang, Qianxiang
    Yang, Shoumeng
    Xie, Tao
    Mei, Hong
    [J]. FSE'16: PROCEEDINGS OF THE 2016 24TH ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON FOUNDATIONS OF SOFTWARE ENGINEERING, 2016, : 690 - 701
  • [35] Change-aware Dynamic Program Analysis for Java']JavaScript
    Murthy, Dileep Ramachandrarao Krishna
    Pradel, Michael
    [J]. PROCEEDINGS 2018 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2018, : 127 - 137
  • [36] Functional Testing of Java']Java Programs
    Benac Earle, Clara
    Fredlund, Lars-Ake
    [J]. TRENDS IN FUNCTIONAL PROGRAMMING (TFP 2015), 2016, 9547 : 40 - 59
  • [37] To Type or Not to Type: Quantifying Detectable Bugs in Java']JavaScript
    Gao, Zheng
    Bird, Christian
    Barr, Earl T.
    [J]. 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2017, : 758 - 769
  • [38] An SMT-Based Concolic Testing Tool for Logic Programs
    Fortz, Sophie
    Mesnard, Fred
    Payet, Etienne
    Perrouin, Gilles
    Vanhoof, Wim
    Vidal, German
    [J]. FUNCTIONAL AND LOGIC PROGRAMMING, FLOPS 2020, 2020, 12073 : 215 - 219
  • [39] Type-aware Convolutional Neural Networks for Slot Filling
    Adel, Heike
    Schuetze, Hinrich
    [J]. JOURNAL OF ARTIFICIAL INTELLIGENCE RESEARCH, 2019, 66 : 297 - 339
  • [40] A type-aware coding approach for unequal message protection
    Yao, Xinyuanmeng
    Wan, Hai
    Ma, Xiao
    [J]. PHYSICAL COMMUNICATION, 2022, 53