Sound Regular Expression Semantics for Dynamic Symbolic Execution of JavaScript

10/10/2018
by   Blake Loring, et al.
0

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. 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

READ FULL TEXT
research
11/08/2021

Solving String Constraints With Regex-Dependent Functions Through Transducers With Priorities And Variables

Regular expressions are a classical concept in formal language theory. R...
research
10/30/2022

gMeta: Template-based Regular Expression Generation over Noisy Examples

Regular expressions (regexes) are widely used in different fields of com...
research
10/23/2020

Automatic Repair of Vulnerable Regular Expressions

A regular expression is called vulnerable if there exist input strings o...
research
01/29/2022

Symbolic-Numeric Integration of Univariate Expressions based on Sparse Regression

Most computer algebra systems (CAS) support symbolic integration as core...
research
08/24/2017

A Computational Interpretation of Context-Free Expressions

We phrase parsing with context-free expressions as a type inhabitation p...
research
04/13/2017

A Search for Improved Performance in Regular Expressions

The primary aim of automated performance improvement is to reduce the ru...
research
12/08/2022

Technical Report: Match-reference regular expressions and lenses

A lens is a single program that specifies two data transformations at on...

Please sign up or login with your details

Forgot password? Click here to reset