xsl-list
[Top] [All Lists]

Re: [xsl] ANN: 'Testing XSLT' training course PDF available

2007-12-17 04:56:29
On 17/12/2007, Tony Graham 
<Tony(_dot_)Graham(_at_)menteithconsulting(_dot_)com> wrote:
On Fri, Dec 14 2007 12:31:37 +0000, 
andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com wrote:
...
You mention black box testing under the unit test heading... which
doesn't quite fit.

Personally I don't think you can unit test XSLT*, it's only really
worthwhile to test the output for a given set of inputs.

Which is the sense in which I used "black box".

It's not "unit testing" then... surely?

If the specification for the transform includes:

   'art' becomes 'article' containing 'front/article-meta'.

then you could use one of the unit testing frameworks to test that part
of the specification without needing to look inside the stylesheet.  You
could also use Schematron (Debbie Lapeyre was teaching Schematron in the
next timeslot) or other methods to do the same thing.

Again, you can't "unit test" a transform without knowing anything
about it's internals - call it what you like but its not unit testing.

If your example requirement is to ensure that:

<art/>

becomes:

<article>
  <front>
    <article-meta>

then you could use schema aware XSLT and do:

<xsl:template match="art">
        <article xsl:type="article">

...which provided article was defined correctly in the schema it would
give you confidence that if <art/> occurred in the input that
structure would alwats be produced.

Couple that will overall result validation containing XSD 1.1 asserts
and I think that's an ideal testing framework.



-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>