XSpec Schematron + SQF
Posted: Fri Jul 22, 2022 10:54 pm
Hi, I just got done implementing additional Schematron/SQF rules to aid my XSpec authoring efforts. I thought I might suggest you add all/some of these rules to the Oxygen framework as they are generic and tremendously helpful in authoring XSpec unit tests. Basically, the things I validate and in most cases provide fixes for include:
- checks x:description@schematron is pointing to a file
- checks that all x:expect-* @id values reference valid @id values from the Schematron file assert/report elements (QF allows selection from those ids)
- check for correct expect type (assert or report) relative to the schematron rule type (QF will update the expect element as required)
- check test coverage for the Schematron rule ids. This lists Schematron @id values not covered by an expect and the same for those not covered by a expect-not.
- warns if x:description@run-as is not set to 'external' (which I have found to cause problems that are difficult to troubleshoot - all I know is having this setting removes problems with tests running - not entirely sure why)
I added these rules to prevent some of the frustrations I've had working with XSpec. It's really easy to get some of things wrong by mistake and it can be really difficult for someone new to (or even experienced with) Xspec to catch them as in some cases you think tests are working but are not - unlike when the Xspec just doesn't run (which can be difficult to troubleshoot as you need to read/understand the stack trace - particularly the @run-as thing).
Unfortunately I cannot provide you my Schematron as it was done on Boeing's dime so is considered proprietary, but if you are interested in adding this to Oxygen they are fairly easy to implement. If you have any questions I'd be happy to discuss.
Thanks, Scott
- checks x:description@schematron is pointing to a file
- checks that all x:expect-* @id values reference valid @id values from the Schematron file assert/report elements (QF allows selection from those ids)
- check for correct expect type (assert or report) relative to the schematron rule type (QF will update the expect element as required)
- check test coverage for the Schematron rule ids. This lists Schematron @id values not covered by an expect and the same for those not covered by a expect-not.
- warns if x:description@run-as is not set to 'external' (which I have found to cause problems that are difficult to troubleshoot - all I know is having this setting removes problems with tests running - not entirely sure why)
I added these rules to prevent some of the frustrations I've had working with XSpec. It's really easy to get some of things wrong by mistake and it can be really difficult for someone new to (or even experienced with) Xspec to catch them as in some cases you think tests are working but are not - unlike when the Xspec just doesn't run (which can be difficult to troubleshoot as you need to read/understand the stack trace - particularly the @run-as thing).
Unfortunately I cannot provide you my Schematron as it was done on Boeing's dime so is considered proprietary, but if you are interested in adding this to Oxygen they are fairly easy to implement. If you have any questions I'd be happy to discuss.
Thanks, Scott