Closed robredpath closed 7 years ago
I'll do the 'what do we want to test' part, @kindly will evaluate the options
@andylolz 's YAML format
NB these days I’m using gherkin for this. Here are some sample tests.
Thanks @andylolz ! How're you finding it?
Yeah, gherkin is fine for this I think (I’ve previously used it for actual BDD on ODI projects.) I expect tests run slower than they would with a bespoke thing like the IATI rulesets tester… But gherkin/cucumber are pretty widely used / well-documented / maintained etc, so that’s the trade-off I suppose.
I have been doing some research on the suggested options. I am excluding @andylolz yaml format as he is now using gherkin anyway and it has no overriding benefit over the other options.
This is a standard way of doing these kind of rulesets in xml and is commonly used in conjunction with xmlschema. It is different from xmlschema as you do not have to specify the whole structure of the document but just certain constraints or rules that you want it to conform to.
I found this pdf a good primer to it.
Pros:
Cons
Pros:
Cons:
Pros:
Cons:
I have come round to the idea of using gherkin, especially as the human readability of the rulesets is so much better then any other option and at least the structure of the rules are standard. Some part of me thinks schematron is the "proper" way to do this (as its a standard and has lots of support) but it will take some learning for any coder to understand how to write them. It is also a taste thing as I do not have much experience of XML and gherkins look much easier to get started with especially as @andylolz has already begun this work.
I wonder if it’s worth mentioning:
Obviously this is all for the IATI-specific flavour of CoVE, buuut… I suppose it’s possible you might at some point want something similar to this for 360giving / OpenContracting? Is that a consideration? (It’s possible this was baked into the “In XML!” con against schematron.)
@andylolz yup, we're having a conversation about how this cuts across standards at the moment; this is a theme that's either come up or is on the horizon for both OCDS and 360, so we're hoping to find a solution that can be widely applied.
We know that we want to test data against sets of rules. We know that there are at least 3 ways that we can do this:
We should take 1 day to work out: