%O First published online November 28, 2013 %J Journal of Logic and Computation %R 10.1093/logcom/ext071 %D 2013 %K Black-box testing; generation of data structures; bounded exhaustive testing; constraint logic programming; program transformation; %X The goal of Bounded-Exhaustive Testing (BET) is the automatic generation of all test cases satisfying a given invariant, within a given size bound. When the test cases have a complex structure, the development of correct and efficient generators becomes a very challenging task. In this paper we use Constraint Logic Programming (CLP) to systematically develop generators of structurally complex test data structures. We follow a declarative approach which allows us to separate the issue of (i) defining the test data structure in terms of its properties, from that of (ii) efficiently generating data structure instances. This separation helps establish the correctness of the developed test case generators. We rely on a symbolic representation and we take advantage of efficient search strategies provided by CLP systems for generating test instances. Through a running example taken from the literature on BET, we illustrate our test generation framework and we show that CLP allows us to develop easily understandable and efficient test generators. Additionally, we propose a program transformation technique whose goal is to make the evaluation of these CLP-based generators much more efficient and we demonstrate its effectiveness on a number of complex test data structures. %L eprints1812 %A Fabio Fioravanti %A Maurizio Proietti %A Valerio Senni %I Oxford University Press %T Efficient Generation of Test Data Structures using Constraint Logic Programming and Program Transformation