GithubHelp home page GithubHelp logo

recordreplay's Introduction

RecordReplay

Make any integration test fast!

What is Record Replay?

This repo is a demonstration of a caching technique for slow dependencies of a system under test. The idea is to create a RR cache of the dependency, which will spin up the actual dependency if it receives a call it hasn't seen before. However, as long as it receives calls it has seen before, it will return whatever was returned the first time around.

Stateful objects

The technique is intended to memoize highly stateful objects such as databases, so it is assumed that all calls modify the state of the object.

Example

var kvs = new InMemoryKeyValueStore(); // In reality you'd want a persisted store
var foo = RecordReplay<IFoo>.Create(kvs, () => new SlowFoo());
foo.Append("HELLO"); // Our SlowFoo will be created at this point
var output = foo.Append("GOODBYE");

var foo2 = RecordReplay<IFoo>.Create(kvs, () => new SlowFoo());
foo2.Append("HELLO"); // At this point another SlowFoo won't be created, and the cache will be used
var output = foo2.Append("GOODBYE");

recordreplay's People

Contributors

samblackburn avatar

Stargazers

Dan Osborne avatar

Watchers

James Cloos avatar  avatar Raees Aamir 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.