Giter Site home page Giter Site logo

omc_sim's Introduction

Tested cases (from email):

Done Test case description
code should fail on integer prices
varying symbols
overflows
underflows
long string sequences
floating order size
wrong field composition
error output
specific process termination
crash exceptions
detect errors and crashes as unexpected behavior
detect errors as expected reaction to a wrong input

Structure:

  • bin directory has the exchange_sim executable
  • tests directory has the test invocations
  • test_data directory has the relevant invocations
  • operational directory has the test logic in it

The test data in test_data directory comtains grouped interaction scripts, where fields are (all required):

Field Description
Order string
Execution string if expected, None if not
Error string if expected, None if not

The test logic is as following:

Test invocations start the ./bin/exchange_sim process usin the exchange_sim test fixture. The fixture also starts two background threads which transfer the exchange_sim output to buffered queues.

After that the invocations feedthe use cases into the batch processor, which is decorated with the check_process function. The check_process function is responsible for all process-related issues, like IOErrors, crashes, and final cleanup (partially).

The batch function feeds the orders to simulator via stdin and after each order checks an expected outcome - both in trades and error feeds.

As errors were not specified in the spec, the tests only check for a presence of an error. Later error detection can be improved, including pattern matching.

Other improvements may be to merge test invocations in one method - currently not done as pytest Does not have a "mark failed and continue" behavior, which means that the batch of tests will stop after the first failure.

omc_sim's People

Contributors

didenko avatar

Watchers

 avatar  avatar

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.