Code Monkey home page Code Monkey logo

symbiote's Introduction

Symbiote

Iteration of the Symbiotic-Data Test Suite.

This project aims to be a network agnostic and data format agnostic serialization verifier - it's main purpose is to verify that data, operations on that data, and serialization of that data is all consistent for multiple platforms. This project defines a trivial protocol that can be re-implemented in any platform, over any network medium.

How the Protocol Works

It's a pretty simple idea:

Setting

Basically, the test suite envolves two peers - we'll call them Peer A and Peer B, and they're connected by some network. Likewise, they are both using (possibly different) systems, which we've denoted as Lang A (like Haskell) and Lang B (like PureScript / JavaScript).

The goal of this suite is to ensure that the same idea defined on these different platforms have the same representation - both operationally (i.e., QuickCheck laws) and through some encoding (like printing the data to JSON or a ByteString).

In the diagram above, each system has some idea of what "Type T" looks and feels like, but could be completely different implementations on each system. Again, though, we care about their outcome being identical; so we disambiguate the idea from the data.

Protocol

The first step in the protocol is for the generating party (Peer A) to generate an instance of Type T, and an operation on that type - this operation, too, needs a serialization implementation (but for most intents and purposes, the implementation will be only for the scope of use with this test suite).

Peer A then does two things: it serializes both the operation and instance to the network-acceptable format, and it "performs" the operation on that instance to get an expected result. Basically, Peer A is using Peer B as a remote procedure call for that operation, and verifying that the result obtained remotely is identical to the result obtained locally.

Remote Procedure Call

As just stated, Peer A then sends the serialized instance and operation to Peer B over that network, where Peer B decodes the data, and performs the operation. Peer B then encodes the result, and sends it back to Peer A.

Verification

Peer A now receives the performed data from Peer B, and can now decode it, and test to see if it is equal to the expected result. If it is, it will tell Peer B that it's "their turn" to generate data.

All of this relies on QuickCheck to generate the data - with the size of the generated data increasing at each step, until a maximum is reached (which is clarified in the documentation).


For an example, check out the tests - they are performed both locally in an asynchronous channel, and remotely with its sister package - purescript-symbiote.

symbiote's People

Contributors

athanclark avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

symbiote's Issues

Clients should be able to select a subset of topics that a server provides

Some clients will be partially defined - i.e. JavaScript cannot define 64-bit integers, or some libraries might only define specific types like the scientific data type. This means that each session a server sees from a client must be uniquely definable with the available topic types - not universal as the current implementation.

This will likely require a slight variation of the current "writer of mappings" for the test suite monad, in addition to a change for the symbiote First and Second data types / protocol specification in symbiotic-data.github.io.

Furthermore, it may be worthwhile implementing a middleware architecture similar to WAI for this project, so unsupported topics in one suite / library may be implemented in another suite, but ran on the same protocol. This may be beyond the scope, but I think it's worth considering.

Server should handle multiple clients

In both the zeromq and websocket protocol instances, there should be a way to have a "reference" version of some suite of data types and operations - this means that a server should be able to handle multiple clients at the same time, and be a publicly visible instance on some remote node.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.