Hostname: page-component-77f85d65b8-9nbrm Total loading time: 0 Render date: 2026-04-17T22:24:31.084Z Has data issue: false hasContentIssue false

Generating constrained random data with uniform distribution

Published online by Cambridge University Press:  13 July 2015

KOEN CLAESSEN
Affiliation:
Department of Computer Science and Engineering, Chalmers University of Technology, Gothenburg, Sweden (e-mail: koen@chalmers.se, jonas.duregard@chalmers.se, michal.palka@chalmers.se)
JONAS DUREGÅRD
Affiliation:
Department of Computer Science and Engineering, Chalmers University of Technology, Gothenburg, Sweden (e-mail: koen@chalmers.se, jonas.duregard@chalmers.se, michal.palka@chalmers.se)
MICHAŁ H. PAŁKA
Affiliation:
Department of Computer Science and Engineering, Chalmers University of Technology, Gothenburg, Sweden (e-mail: koen@chalmers.se, jonas.duregard@chalmers.se, michal.palka@chalmers.se)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

We present a technique for automatically deriving test data generators from a given executable predicate representing the set of values we are interested in generating. The distribution of these generators is uniform over values of a given size. To make the generation efficient, we rely on laziness of the predicate, allowing us to prune the space of values quickly. In contrast, implementing test data generators by hand is labour intensive and error prone. Moreover, handwritten generators often have an unpredictable distribution of values, risking that some values are arbitrarily underrepresented. We also present a variation of the technique that has better performance, but where the distribution is skewed in a limited, albeit predictable way. Experimental evaluation of the techniques shows that the automatically derived generators are much easier to define than handwritten ones, and their performance, while lower, is adequate for some realistic applications.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2015 
Submit a response

Discussions

No Discussions have been published for this article.