oasis-tcs / csaf

OASIS CSAF TC: Supporting version control for Work Product artifacts developed by members of TC, including prose specifications and secondary artifacts like meeting minutes and productivity code
https://github.com/oasis-tcs/csaf
Other
148 stars 39 forks source link

Add validation tests #195

Closed tschmidtb51 closed 3 years ago

tschmidtb51 commented 3 years ago

We have some parts which can't be enforced be the schema itself but should be tested programmatically. Therefore, I suggest to add those tests to the standard to ease the pain. Here are some ideas:

tschmidtb51 commented 3 years ago

We should also take that into account in #193 and #191.

mprpic commented 3 years ago

+1 for implementing validation checks. I assume this could be baked into the existing parser library (https://github.com/oasis-open/csaf-parser), though I guess it should be updated to support CSAF 2.0 first. Or do we think the community would prefer a standalone library for parsing and validation for CSAF 2.0 (I don't really have an opinion on this)?

tschmidtb51 commented 3 years ago

I'm not sure what the current status of the csaf-parser is and whether it is written in a way that it can be upgraded easily.

Maybe @sthagen can elaborate on that...

As a user, I would probably prefer a library which I can include in my own implementation...

sthagen commented 3 years ago

I am open to support csaf-parser but it may have a lot of baggage from the past.

I will start to implement the suggested schematron like tests of this ticket in csaf-lint.

But, not tomorrow, as tomorrow I have a day off ... anything 😄

tschmidtb51 commented 3 years ago

This is also related to #214. The following tests are mentioned there:

tschmidtb51 commented 3 years ago

This is also related to #202. The following test is mentioned:

sthagen commented 3 years ago

One question placed here may well be moved ... what is the expected value of the source_lang field when translating more than once (not iterating but from language to language ...)?

Is the true source language the value of the lang field from the very first advisory or just the "previous" one?

(source_lang, lang): (en, en) -> (en, fr) -> (en, de) ... (en, es)

or (I assume it can be this latter):

(source_lang, lang): (en, en) -> (en, fr) -> (fr, de) ... (pl, es)

tschmidtb51 commented 3 years ago

Here is a list of potential "informational" tests:

tschmidtb51 commented 3 years ago

This is also related to #239:

mprpic commented 3 years ago

All the tests listed here make sense to me!

Couple more suggestions for informational tests: