XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
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] defining correctness for an XML transformation - how?

If yes, then the way to verify the correctness of an XML-to-XML conversion is:

  1. Validate the source element against the XML Schema for the source element
  2. Validate the converted target element against the XML Schema for the target element
  3. Create a predicate that the source-target conversion must satisfy and evaluate the predicate
  4. If all predicates return true, then the correctness of the conversion is verified



It all depends what you mean by "verified". Yes, you have passed all your test cases. But you haven't proved that your program is correct, or that it will deliver correct results when applied to other cases. 

In your example there's clearly a disconnect between your narrative specification, which says trailing spaces are removed, and your predicate (using normalize-space()) which also removes leading spaces and multiple internal spaces. Perhaps none of your test cases contains leading spaces: so your testing is incomplete. Perhaps the real data will never contain leading spaces either. In that case the schema for the input is incomplete.

Either way, you haven't verified correctness, you have merely passed some tests.

Michael Kay
Saxonica


[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