XML instances, differently from a random based ap-
proach, clearly has important consequences on the ef-
fectiveness of the generated test suite permitting to
derive meaningful statistics on the kind of instances
generated, and then on the covered features.
In this perspective, a proof-of-concept tool, called
TAXI (Testing by Automatically generated XML In-
stances) for the systematic generation of XML in-
stances (Bertolino et al., 2006) according to the XML-
based Partition Testing (XPT) method has been previ-
ously developed. It takes in input an XML Schema
and automatically generates a set of XML instances,
by implementing several criteria and heuristics, so
that it can be used as test data for the black box test-
ing of a component, whose expected input conforms
to the taken schema.
The contribution of this paper is exploit the poten-
tial of the tool TAXI for testing the XSLT Transforma-
tion tool. If from one said there are explicit models of
the data domain, i.e. XML Schemas, correspondingly
there is the more increasing needs of mechanisms for
transforming one format into another. Technologies
developed for such purpose require the definition of
documents called Stylesheets. These define how data
described within a specific input document should be
transformed and formatted into the target document.
With reference to the context of Web applications cer-
tainly the most successful specification for such pur-
pose is that of the eXtensible Stylesheet Language
Transformation (XSLT) (W3CXSLT, 1999).
However writing down explicitly the rules that
allow specific transformations sometimes is a quite
complex work especially when the transformation
output should adhere to precise XML format, such
as Schemas. In such cases the possibility of making
errors in the stylesheet could be considerable and in
parallel the difficulty in identifying them could have
a hight increase. As a consequence, due to the impor-
tance and the criticality of these documents, the ne-
cessity of methods for automatically testing the cor-
rectness of the stylesheets and quickly identifying
their source of errors arise.
This paper wants to face exactly this last need, and
provides, by means of TAXI, a testing framework for
automatically and systematically generate test cases
for verifying the XSLT Stylesheets correctness. We
therefore assume that the the input and the output of
the XSLT Stylesheets are and have to be, respectively,
conform to given XML Schemas. Thus we use TAXI,
for automatically generate the set of test cases to be
run with the tested XSLT Stylesheet, and with and a
XML Validatior for automatically check the correct-
ness of the transformations.
In the rest of the paper we present an overview of
the related works (Sec. 2) and a brief description of
the TAXI tool (Sec. 3). Then we describe the appli-
cation use of TAXI for testing the XSLT Transforma-
tion Processor (Sec. 4) and the application of the in-
tegrated testing framework to some case studies (Sec.
5). Conclusions are briefly drawn in (Sec. 6).
2 RELATED WORKS
Nowaday XSLT is used widely in web, document
composition, electronic and print publishing applica-
tions. Increasingly, in some cases, XSLT Stylesheet
becomes the core of document creation and process-
ing pipelines. XSLT Stylesheets are getting larger
and more complex, and containing the information of
business logic. The correctness of XSLT Stylesheets
then becomes an extremely important factor that can
affect the software quality.
There are a lot of tools that already exist for
XSLT testing. Most of them do unit testing to
XSLT Stylesheets. Such as UTF-X (Radajewski and
Daniel, 2006), which is an extension to the JUnit
Java unit testing framework and provides function-
ality for unit testing XSLT stylesheets and strongly
supports the test-first-design principle; tennison-tests
(tennison, 2006), which allows user to write unit-tests
in XML, and exercising XSLT from Ant; and Al-
ster (Alster, 2006), which is an XSLT unit testing
framework, allows the creation and “execution” of
XSLT Stylesheets containing specially marked “test
templates”.
The main weakness of these tools is in the selec-
tion of test cases, which is mainly based on manual
setting. Since XSLT becomes more and more com-
plex, the costs of test cases creation is rising rapidly.
3 TAXI
In this section we briefly describe the XPT methodol-
ogy. For space limitations, we assume a basic knowl-
edge of XML and XML Schema, and in the text we
will refer to the elements of XML Schema using this
format
.
The XPT methodology is largely inspired to the
well-known Category Partition (CP) technique (Os-
trand and Balcer, 1988), which provides a stepwise in-
tuitive approach to identify the relevant input param-
eters and environment conditions and combine their
significant values into an effective test suite. While
the original CP technique relied on a specification ex-
pressed in natural or semiformal language, the XML
Schema today provides an accurate representation of
XMODEL-BASED TESTING OF XSLT APPLICATIONS
283