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 条
  • [41] TaGSim: Type-aware Graph Similarity Learning and Computation
    Bai, Jiyang
    Zhao, Peixiang
    [J]. PROCEEDINGS OF THE VLDB ENDOWMENT, 2021, 15 (02): : 335 - 347
  • [42] Guided Mutation Testing for Java']JavaScript Web Applications
    Mirshokraie, Shabnam
    Mesbah, Ali
    Pattabiraman, Karthik
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2015, 41 (05) : 429 - 444
  • [43] The effectiveness of client-side Java']JavaScript Testing
    Moon, Jonny
    Farnsworth, Brian
    Smith, Riley
    [J]. 2020 IEEE/ACM 15TH INTERNATIONAL CONFERENCE ON AUTOMATION OF SOFTWARE TEST, AST, 2020, : 101 - 102
  • [44] 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
  • [45] Review on Key Technologies of Lightweight Type-Aware LiDAR
    Xiaolu, Li
    Yier, Zhou
    Tengfei, Bi
    Ruiqin, Yu
    Zining, Wang
    Jianbin, Huang
    Lijun, Xu
    [J]. CHINESE JOURNAL OF LASERS-ZHONGGUO JIGUANG, 2022, 49 (19):
  • [46] JS']JSDeodorant: Class-awareness for Java']JavaScript programs
    Eshkevari, Laleh
    Mazinanian, Davood
    Rostami, Shahriar
    Tsantalis, Nikolaos
    [J]. PROCEEDINGS OF THE 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING COMPANION (ICSE-C 2017), 2017, : 71 - 74
  • [47] Semantic Patches for Adaptation of Java']JavaScript Programs to Evolving Libraries
    Nielsen, Benjamin Barslev
    Torp, Martin Toldam
    Moller, Anders
    [J]. 2021 IEEE/ACM 43RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING: COMPANION PROCEEDINGS (ICSE-COMPANION 2021), 2021, : 229 - 229
  • [48] 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
  • [49] Precise String Analysis for Java']JavaScript Programs Using Automata
    Almashfi, Nabil
    Lu, Lunjin
    Picker, Koby
    Maldonado, Christian
    [J]. 2019 8TH INTERNATIONAL CONFERENCE ON SOFTWARE AND COMPUTER APPLICATIONS (ICSCA 2019), 2019, : 159 - 166
  • [50] Completeness of Abstract Domains for String Analysis of Java']JavaScript Programs
    Arceri, Vincenzo
    Olliaro, Martina
    Cortesi, Agostino
    Mastroeni, Isabella
    [J]. THEORETICAL ASPECTS OF COMPUTING - ICTAC 2019, 2019, 11884 : 255 - 272