[xsl] Re: Unit Testing — Good but Not Sufficient

Subject: [xsl] Re: Unit Testing — Good but Not Sufficient
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 31 Mar 2026 12:28:49 -0000
Hi Rick,
Thank youbthatbs a really helpful way to frame it.
The distinction youbre making around granularity clarified something for me.
In my case, most of the Schematron rules I wrote were invariants applied
across the full dataset, but they were generally fairly
coarse-grainedbfocused on things like mappings, decode logic, and
consistency across tables.
What Ibm taking from your note is that there are really two dimensions at
play:

  *   scope (unit testing vs. full-dataset/invariant testing), and
  *   granularity (how precise or restrictive the rules are)
The invariant checks give broad coverage, but they donbt necessarily
exercise edge conditions in the same way that targeted unit tests do. And as
you point out, stronger guarantees come from increasing the granularity of the
invariants as well as expanding unit test coverage.
In fact, looking back at the rules I wrote, I can see how some of the
invariants could be decomposed into more fine-grained checksbfor example,
separating domain constraints, existence checks, and specific mapping
conditionsbrather than relying on a single broader rule.
So Ibm now thinking of it less as bunit testing vs. dataset validationb
and more as a combination of:

  *   unit tests (highly targeted, high granularity),
  *   invariant checks across the dataset (broad coverage), and
  *   the level of granularity of those invariants
Your example makes it clear how those pieces fit together.
Also, the idea of parameterizing Schematron across multiple inputs/outputs is
interestingbI hadnbt explored that, but it seems like a natural extension
for validating relationships across pipeline stages.
Thanks againbthis helped sharpen my thinking.
Best regards,
Roger

Current Thread