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 条
  • [1] In-Situ Concolic Testing of Java']JavaScript
    Li, Zhe
    Xie, Fei
    [J]. 2023 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING, SANER, 2023, : 236 - 247
  • [2] Concolic Testing of Front-end Java']JavaScript
    Li, Zhe
    Xie, Fei
    [J]. FUNDAMENTAL APPROACHES TO SOFTWARE ENGINEERING, FASE 2023, 2023, 13991 : 67 - 87
  • [3] In-Situ Concolic Testing of JavaScript
    Li, Zhe
    Xie, Fei
    [J]. Proceedings - 2023 IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2023, 2023, : 236 - 247
  • [4] Partition-based Coverage Metrics and Type-guided Search in Concolic Testing for Java']JavaScript Applications
    Bae, Sora
    Park, Joonyoung
    Ryu, Sukyoung
    [J]. 2017 IEEE/ACM 5TH INTERNATIONAL FME WORKSHOP ON FORMAL METHODS IN SOFTWARE ENGINEERING (FORMALISE) PROCEEDINGS, 2017, : 72 - 78
  • [5] Concolic Testing of Front-end JavaScript
    Li, Zhe
    Xie, Fei
    [J]. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 2023, 13991 LNCS : 67 - 87
  • [6] Towards a type system for analyzing Java']JavaScript programs
    Thiemann, P
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, PROCEEDINGS, 2005, 3444 : 408 - 422
  • [7] Scaling modified condition/decision coverage using distributed concolic testing for Java']Java programs
    Godboley, Sangharatna
    Dutta, Arpita
    Mohapatra, Durga Prasad
    Mall, Rajib
    [J]. COMPUTER STANDARDS & INTERFACES, 2018, 59 : 61 - 86
  • [8] Generative Type-Aware Mutation for Testing SMT Solvers
    Park, Jiwon
    Winterer, Dominik
    Zhang, Chengyu
    Su, Zhendong
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5 (OOPSLA):
  • [9] Java']Java-HCT: An approach to increase MC/DC using Hybrid Concolic Testing for Java']Java programs
    Godboley, Sangharatna
    Dutta, Arpita
    Mohapatra, Durga Prasad
    [J]. PROCEEDINGS OF THE 2016 FEDERATED CONFERENCE ON COMPUTER SCIENCE AND INFORMATION SYSTEMS (FEDCSIS), 2016, 8 : 1709 - 1713
  • [10] On Type-Aware Entity Retrieval
    Garigliotti, Dario
    Balog, Krisztian
    [J]. ICTIR'17: PROCEEDINGS OF THE 2017 ACM SIGIR INTERNATIONAL CONFERENCE THEORY OF INFORMATION RETRIEVAL, 2017, : 27 - 34