decentralized-identity / peer-did-method-spec

A rich DID method that has no blockchain dependencies. The verifiable data registry is a synchronization protocol between peers.
https://decentralized-identity.github.io/peer-did-method-spec/index.html
Apache License 2.0
27 stars 17 forks source link

Create a test suite #3

Open dhh1128 opened 4 years ago

dhh1128 commented 4 years ago
  1. Define a strategy. (We currently have some sample data checked in. This gives well-formed and invalid peer DIDs. I started to create well-formed and invalid DID doc deltas as well, but I can't remember how far I got on this. The intent is that a test suite would consume all the well-formed peer DIDs and prove that an impl considers them well-formed, all the invalid DIDs and confirm that an impl complains, and would consume all the deltas and produce the defined results when doing a resolution. Thus, the data is the main driver; all we should have to do is drop new data files into the appropriate folders, and whatever test suite we write will get more robust. Perhaps this strategy needs improving; I haven't thought it through deeply. But I like the fact that it's not unduly tied to a particular test technology.)

  2. Implement the suite.

TimoGlastra commented 2 years ago

You mentioned you started with defining did doc deltas, do you have any test vectors for dids other than level 1 (mainly interested in level for DID Exchange).

There's some tricky parts in the spec that I think will be interpreted differently by different implementors. Method 0 is easy to test with did key test vectors, but transforming method 2 did documents to dids and vice versa, or generating the did for a method 1 did document are trickier.

If helpful I can provide some documents based on our implementation once ready, but not sure whether those are correct...

dhh1128 commented 2 years ago

I believe that DSR's peer DID implementations in python included some test vectors. Pinging @DenisRybas , who I believe knows about that.

DenisRybas commented 2 years ago

Yes, we have some test vectors of method 0 and 2 in our implementation. Here is the link: https://github.com/sicpa-dlab/peer-did-python/blob/main/tests/test_vectors.py Also i recommend to check test_create_peer_did_numalgo_* and test_resolve_peer_did_numalgo_* files here https://github.com/sicpa-dlab/peer-did-python/tree/main/tests

TimoGlastra commented 2 years ago

This is really helpful, thanks!

Spotted a few mistakes thanks to this :)

TimoGlastra commented 2 years ago

@dhh1128 and @DenisRybas do you know if there are any test vectors available for method 1? I'm having a hard time determining whether my implementation is correct without being able to verify it against something.