Skip to Main content Skip to Navigation
Conference papers

Automated Random Testing of Numerical Constrained Types

Abstract : We propose an automated testing framework based on constraint programming techniques. Our framework allows the developer to attach a numerical constraint to a type that restricts its set of possible values. We use this constraint as a partial specification of the program, our goal being to derive property-based tests on such annotated programs. To achieve this, we rely on the user-provided constraints on the types of a program: for each function f present in the program, that returns a constrained type, we generate a test. The tests consists of generating uniformly pseudo-random inputs and checking whether f 's output satisfies the constraint. We are able to automate this process by providing a set of generators for primitive types and generator combinators for composite types. To derive generators for constrained types, we present in this paper a technique that characterizes their inhabitants as the solution set of a numerical CSP. This is done by combining abstract interpretation and constraint solving techniques that allow us to efficiently and uniformly generate solutions of numerical CSP. We validated our approach by implementing it as a syntax extension for the OCaml language.
Document type :
Conference papers
Complete list of metadata
Contributor : matthieu dien Connect in order to contact the contributor
Submitted on : Friday, May 13, 2022 - 2:51:40 PM
Last modification on : Tuesday, June 14, 2022 - 7:09:04 AM


Publisher files allowed on an open archive



Ghiles Ziat, Matthieu Dien, Vincent Botbol. Automated Random Testing of Numerical Constrained Types. 27th International Conference on Principles and Practice of Constraint Programming (CP 2021), Oct 2021, Montpellier, France. ⟨10.4230/LIPIcs.CP.2021.59⟩. ⟨hal-03667623⟩



Record views


Files downloads