OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Testing XML don't use xUnit

On Thu, Apr 11, 2013 at 4:04 AM, George Cristian Bina
<george@oxygenxml.com> wrote:
> Hi Ihe,
> People asked for a Schematron example that you think cannot be written as an
> XPath only test then they wanted to show you the equivalent XPath for that.
> Basically, in Schematron you have
> rule/@context = XPath expression
> assert/@test = XPath expression
> these can be written in XPath 2.0 as
> //(context)/test
> where context is the rule/@context expression and test is the assert/@test
> expression.
> So, the challenge will be to come up with a Schematron example for which
> someone cannot write an XPath equivalent. If you cannot provide such an
> example then you should accept that they are equivalent, at least for your
> use cases.

I am sorry I have no idea what that challenge has to do with what I
have been illustrating.

I can spend a moment to reconstruct an analogy revealing the relevant point.

I have written a push style stylesheet. My challengers are claiming
anything they can write push style they can write pull style.

Yes. I accept.

The relevant property I am claiming is that in the next iteration of
the development my push style stylesheet will be more resilient to
changes in the XML structure than my challengers pull style

Or to deconstruct the analogy.

Lets assume that iteration 2 makes structural changes while retaining
the same behaviour. Lets say those changes entail some wrapping and
unwrapping of elements and renaming others.

Then my claim is that my schematron assertions will require less (if
any) rework than your xUnit assertions.


1. I wouldn't be obliged to respond to any other type of challenge.

2. The other response is  I can spin some XQuery  or I can write my
xUnit  (or hire devs) with sufficient skill to do the equivalent of
what you are claiming Schematron gives you out of the box then. An
admittedly exaggerated analogy to that argument would be a C
programmer arguing against the necessity of a language feature native
to  an object oriented language on grounds that with enough skill and
bolt ons, the same effect can be replicated in C.

A more nuanced viewpoint would be to see how the inherent robustness
of Schematron assertions can be blended with the things that are liked
about xUnit.

I did at one point consider writing a paper about some of this stuff
and some other observations because some of the other ideas that have
emerged since developers suddenly decided that they were interested in
testing are - shall we say - a bit kookoo. However this brief road
test persuades me that it would be better to focus my attention on
other challenges.

I was toying with the idea

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS