[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] defining correctness for an XML transformation - how?
- From: Michael Kay <mike@saxonica.com>
- To: Roger L Costello <costello@mitre.org>
- Date: Thu, 4 Jul 2024 00:23:10 +0100
If yes, then the way to verify the correctness of an XML-to-XML conversion is:
- Validate the source element against the XML Schema for the source element
- Validate the converted target element against the XML Schema for the target element
- Create a predicate that the source-target conversion must satisfy and evaluate the predicate
- 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]