Re: [xsl] How do you ensure that data is not altered/corrupted in a transformation?

Subject: Re: [xsl] How do you ensure that data is not altered/corrupted in a transformation?
From: "Piez, Wendell A. (Fed) wendell.piez@xxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 May 2023 14:23:26 -0000
Hello again XSL-List,

Posting from my bother emailb (apologies to indexers) b

Itbs worth remarking on Rogerbs general problem that rewriting b10000b
as b1000b (or something) is only one of the many conceivable things that
might go wrong inside a black box, against which one might test.

Then too, testing for data fidelity (as I call it) is one kind of testing, but
it wonbt protect against errors such as failing to account for different
units of measure for `altitude` and `alt` (in their respective vocabularies),
or their meaning something entirely different. (Does anyone else remember the
Stonehenge replica in Spinal Tap?)

Early detection of problems like this is possible, but only when they are
expected and defended against by staging mockups and testing models against
use cases. This may sound like a lot of work until you realize it is nothing
new, but (at some level) how things have always had to be done. It can only be
made bautomaticb if we understand it i.e. are not oblivious to it,
paradoxical as that sounds. The reason this scales is that bweb can be a
small number (serving a larger number who can remain oblivious) b but it
canbt be zero, or things gets loose and break. An automaton does not
bunderstandb anything, it only captures and codifies some kind of
understanding. Whether that understanding is adequate or btrueb is
something it canbt know, because it doesnbt know anything at all.

Cheers, Wendell

From: Wendell Piez wapiez@xxxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, May 19, 2023 7:37 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] How do you ensure that data is not altered/corrupted in a
transformation?

XSpec is a unit testing framework for and in XSLT. Its capabilities go far
beyond what schema validation was ever intended to do.

Roger, if you aren't using XSpec, you should be.

https://github.com/xspec/xspec/wiki

Regards, Wendell

On Fri, May 19, 2023 at 6:13b/AM Michael Kay
mike@xxxxxxxxxxxx<mailto:mike@xxxxxxxxxxxx>
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx
rytech.com>> wrote:
Testing, testing, testing. Plus tools to help prevent the mistakes arising in
the first place.

Schema validation can catch a lot of the errors, but it won't catch them all.

We had a case like this where a customer was flagging up dangerous levels of
some reading in medical reports by displaying the relevant figures in red.
When they upgraded from XSLT 1.0 to 2.0, the test $level > $dangerLevel
started doing a string comparison rather than a numeric comparison, with the
effect that the red flags weren't appearing -- and it took them months to
notice, because they weren't doing enough testing. Hopefully no-one died.
Tests are the only answer: and because stylesheets can be thrown together
quickly, people often neglect to follow good software engineering disciplines
when changing them.

Michael Kay
Saxonica

> On 19 May 2023, at 09:37, Roger L Costello
costello@xxxxxxxxx<mailto:costello@xxxxxxxxx>
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx
rytech.com>> wrote:
>
> Hi Folks,
>
> In certain domains loss of life may occur if data is altered/corrupted in
any way.
>
> Suppose you write an XSLT program which transforms this:
>
> <alt>12000 feet</alt>
>
> to this:
>
> <altitude>12000 feet</altitude>
>
> How do you ensure that the data -- 12000 feet -- was not altered/corrupted
in the transformation?
>
> I have heard of people doing a hash on the data prior to the transformation,
a hash on the data after the transformation, and then comparing the hashes. Is
that what you would do when lives are on the line? What is your
recommendation?
>
> /Roger
>
>



--
...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
...github.com/wendellpiez.<http://github.com/wendellpiez.>..
...gitlab.coko.foundation/wendell...
XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3302254> (by
email<>)

Current Thread