Split testing
The purpose of this module is to aid in split testing node.js based applications, whether it's in the browser, or backends.
Scope
This module provides a generic way to setup and measure experiments with weighted outcomes.
Conclusions of what outcome performed the best cannot be determined only by using this module.
Example usage
; // setup the experimentconst experiment = // Name of this test, to be able to distinguish between tests when running // multiple at the same time. name: 'green-vs-red-btn' // Configure the different outcomes that you want to test, along with a // weight that tells how likely the outcome is. outcomes: 'green' 05 'red' 05 // Supply a function that will be triggered when evaluating an experiment. { console; } // (Optional) Persisting functions, when you want the first outcome be become // sticky for this particular user. persist: read write // (Optional) Used in multi-user contexts, such as backend applications to // distinguish between users when persisting the outcome. userId: 3; // evaluate the actual experimentexperiment; // Example of persisting functionsconst fakeDb = {}; { return Promise;} { fakeDbkey = outcome; return Promise;}