xspec / xspec

XSpec is a unit test and behaviour-driven development (BDD) framework for XSLT, XQuery, and Schematron.
https://github.com/xspec/xspec/wiki
MIT License
112 stars 31 forks source link

refactor(report): simplify XSLT computation of code coverage status #1966

Closed galtm closed 1 month ago

galtm commented 2 months ago

This pull request refactors the XSLT code that computes code coverage status based on the trace data produced by the Java trace listener. The goal is to make rules like "use trace data", "use child data", "use parent data", or element-specific logic more apparent and easier to maintain.

Between now and the next XSpec release, we plan to change some of the logic in this XSLT code in ways that will change the expected coverage reports. This pull request excludes any such changes -- even bug fixes. In other words, this pull request is pure refactoring.

galtm commented 2 months ago

Locally, I checked that this refactoring does not change the Saxon 12.5 coverage reports in the test/end-to-end/cases-coverage directory. That is, I generated all the expected results with Saxon 12.5 and this repo's master branch, then added the commits from this PR, and then confirmed that the coverage tests pass.

galtm commented 1 month ago

FYI: Although test/end-to-end/cases/custom-coverage-report.xspec tests the ability to generate a custom coverage report, using an XSLT stylesheet that imports coverage-report.xsl, I don't see that ability documented in the wiki. I conclude that refactoring coverage-report.xsl does not affect users and should not be documented as if it were a breaking change.