Skip to content
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

after v1 review: create test vectors to facilitate interoperating implementations #13

Open
cblgh opened this issue Jan 13, 2023 · 0 comments

Comments

@cblgh
Copy link
Member

cblgh commented Jan 13, 2023

when i was helping out on the ssb ngi project that was developing partial replication, we had a concept called testvectors (example) that i think could be really helpful as a resource to have for cable.

given that we're going through a spec review, this should come at the earliest after the v1 has been reviewed, RFCs process is done, and a final version decided on and landed in the spec repo.

so onto what a testvector is: a piece of documentation x example x testbed that gives pairs of [plaintext input, binary output] together with a description of what use case is being demonstrated by the pair.

so, a test vector for a cable hash response would:

  • list the exact values used in one instance of a hash response for the fields that make up the message type
  • give the corresponding buffer that a correct cable implementation would produce, for the specified input

we can also provide test vectors that do not work. e.g faulty input that should not result in a cablegram

the end result is that implementors have, in addition to the spec, a set of clear language-independent test cases they can try their implementation against. they can input the inputs and compare it against the generated buffer, as well as take the buffer and decode it to hopefully arrive at the given inputs.

i don't care so much about the format in particular, the example above is just one format we could choose. i would personally be happy with having a markdown document for test vectors, where each vector is listed as a description, the inputs, as well as the base16 encoded bytes representing the cablegram.

@cblgh cblgh changed the title after v1 review: create test vectors to facilitate interoperating implementation after v1 review: create test vectors to facilitate interoperating implementations Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant