[xsl] bad code Re: Subject: ChatGPT results are "subject to review"

Subject: [xsl] bad code Re: Subject: ChatGPT results are "subject to review"
From: "Dorothy Hoskins dorothy.hoskins@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 7 Jul 2023 13:26:27 -0000
Hi all, it did not take much investigation to find that there was an
invalidity in the XSLT that was "stupid" (a misplaced attribute constructor
after a child element constructor in a template), and there were various
other things that I improved to get it to produce the same result as my own
XSLT 2 transform that I used for comparison. So at this time, our concern
will be for the people who are just starting out and don't yet understand
why the XSLT is wrong and/or how to fix it.

The more expert of you (I am only middling fair at XSLT) will want to make
your own test cases. My guess is that the more interesting your input and
output and prompts are, the more you will have to draw on your expertise to
decide if the ChatGPT result is correct.

The speed of the results is what is helpful. If you are poking at a
solution bit by bit, you might be able to get some useful code results
quickly to test as you develop. But from what I understand, and what I
experienced myself, writing a good prompt is a science of its own
(well-suited for a number of you experts in the list).

In a way, it walks me back mentally to the development state of
requirements gathering. What is the source content? What do I need to
produce for the client? How can I test my result meets the requirement? It
seems like writing the test cases can also be automated (as I mentioned, I
asked ChatGPT to generate a schematron and an Xspec). I would be interested
in your thoughts about whether using ChatGPT will work better for a
procedural language or a declarative language. (You can ask ChatGPT to
return the generated code in other languages than XSLT. From what I see in
the list of ChatGPT Code languages, it wasn't specifically trained on XSLT,
so someone who builds their own training set will get better results. You
folks probably have the best training examples in the world in the
xsl-list.)

I don't think there's any going back, so the chances of people creating
code that won't run, that they can't debug themselves and which ChatGPT may
not provide the correction required if prompted, is high.

Michael, I wonder what "nasty accidents" you are thinking of -- some XSLTs
used in particular industries with real-world safety issues? Maybe we can
start to create some advice for clients on QA and testing protocols.
- Dorothy

Current Thread