Sound Regular Expression Semantics for Dynamic Symbolic Execution of JavaScript

Blake Loring, Duncan Mitchell, Johannes Kinder
10/10/2018
cs.PL

Official code: ExpoSEJS/ExpoSE (228 stars, JavaScript, MIT, last commit 2025-01-19).

Abstract

Existing support for regular expressions in automated test generation or verification tools is lacking. Common aspects of regular expression engines found in mainstream programming languages, such as backreferences or greedy matching, are commonly ignored or imprecisely approximated, leading to poor test coverage or failed proofs.

Show full abstract

In this paper, we present the first complete strategy to faithfully reason about regular expressions in the context of symbolic execution, focusing on the operators found in JavaScript. We model regular expression operations using string constraints and classical regular expressions and use a refinement scheme to address the problem of matching precedence and greediness. Our survey of over 400,000 JavaScript packages from the NPM software repository shows that one fifth make use of complex regular expressions features. We implemented our model in a dynamic symbolic execution engine for JavaScript and evaluated it on over 1,000 Node.js packages containing regular expressions, demonstrating that the strategy is effective and can increase line coverage of programs by up to 30%

View on arXivView PDF

Code Implementations(1)

ExpoSEJS/ExpoSEOfficial100%
MIT

A Dynamic Symbolic Execution (DSE) engine for JavaScript. ExpoSE is highly scalable, compatible with recent JavaScript standards, and supports symbolic modelling of strings and regular expressions.

22840JavaScript, ShellMay 4, 20171 years agoMIT
bug-fixingjavascriptprogram-analysisprogramming-languagessoftware-testing+2 more

Similar Papers

Cite this paper

@article{loring2018sound,
  title  = {Sound Regular Expression Semantics for Dynamic Symbolic Execution of JavaScript},
  author = {Blake Loring and Duncan Mitchell and Johannes Kinder},
  year   = {2018},
  eprint = {1810.05661},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1810.05661}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1810.05661.svg)](https://codeofpaper.com/paper/1810.05661)

Discussion