Conformance testing, SVRL

Brian Ewins <[email protected]> Tue, 20 Jul 2004 11:35:50 +0100
Newsgroups gmane.text.xml.schematron
Message-ID <[email protected]>
I'm starting to think about how to test my impl for conformance. I've 
looked at SVRL and it seems a step or two short of actually doing an 
output comparison with a reference implementation (which seems like the 
obvious approach). Has anyone else tackled this? Here's what I was thinking:

- run impl1, impl2 with test schema and input, generating svrl1, svrl2
- run a 'conformance' stylesheet (see below) against svrl1 to generate a 
schematron schema check1
- validate svrl2 with check1
- run the 'conformance' stylesheet against svrl2 to generate a 
schematron schema check2
- validate svrl1 with check2

the assertions generated by the conformance stylesheet would test for 
existence of leaf elements, checking all ancestor-or-self element 
names/attributes eg given:
<a x='1'>
    <b y='2'>
       <c/>
    </b>
    <b y='2'>
       <c/>
    </b>
</a>

... we generate one test for existence of "/a[@x='1']/b[@y='2']/c". By 
generating tests from both svrl1 and svrl2, we can test for missing 
items in svrl2, and extra items in svrl2 (since they are 'missing' in 
svrl1). My thinking behind doing tests like this rather than some kind 
of 'diff' is that the order of pattern use is undefined, and that 
fired-rule may or may not appear multiply for a rule in the output of 
some implementations (at different depths...or is this just me!).

I know about the screamatron, but I think it falls short of whats needed 
- you can pass by reporting no errors; also its conformance test is 
hardcoded. The process outlined above should work generically for any 
schema/instance pair, so new tests could be added quickly, and the 
stylesheet required looks fairly doable.

thoughts?

    Baz



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click