-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Suite #52
Comments
Hi @codello, this sounds good to me please go ahead. I'm not a test engineer or someting but we really need a proper and standardized test suite - so I highly appreciate any reasonable efforts. |
There exists https://github.com/UltraStar-Deluxe/songs - why not use that for "good" samples and adjust them on demand as needed? |
That's a really good resource, thank you. I'm actually thinking more about edge cases that are relevant when implementing parsers for the format. Consider these two examples:
Note the following:
Note the following:
These are just some examples but there are a lot more edge cases that aren't immediately obvious. I'd like to build a test suite to cover these to hopefully make it easier for developers to test their implementations against the spec. |
Also relates to #18 |
Suggestion
I'd like to suggest that in addition to the formal specification we include test files in this repository that give examples of files that are considered spec-compliant or non-compliant.
Use case
A comprehensive test suite makes it much easier for developers to build spec-compliant implementations. Writing tests takes a lot of time and there is a high risk that edge cases of the spec go unnoticed. Being able to test an implementation against a set of known valid / invalid files helps to reduce misunderstandings and reduces the barrier of building implementations that are actually spec-compliant.
Extra info/examples/attachments
I'm not sure what the best way of implementing a test suite is. In the spoiler below I outline a first idea. I'm also not sure if this is the right repository for a test suite or if it should get its own repository.
Possible Implementation
This proposal is heavily inspired by the YAML test suite.
General considerations
I think there are two points of view on a test suite: One from the person writing the tests and one from the person using the suite to validate an implementation. For the person writing the tests it's very advantageous to have the test input and the expected result very close to each other (read: in the same file). From an implementor's point of view it's desirable to have the test input as an individual file that can be read as-is.
To satisfy both points of view I think we should have a build step for the test suite.
Structure of the test suite
The test files are placed in a
test
folder. The test suite is written using yaml files. These files contain the tests, the expected output and metadata about the tests (see below). This makes it easy to write tests.During a build step these files are then transformed into a directory structure containing:
error
file, indicating that the input is expected to produce an errorExample
A test file could look like this. This example includes 2 test cases (one expected success and one expected failure).
Open Questions
I'm currently unsure about the following questions:
headers
)?input
be encoded? I'm currently thinking that adding a replacement mechanism for\uXXXX
sequences might be sensible to make test cases more understandable.If there is interest in this feature I'm happy to submit a PR containing the build system and some first test cases. Subsequent cases can be added as the details of the spec are decided.
The text was updated successfully, but these errors were encountered: