ab-test-simulation

This repository contains code for a multithreaded AB testing simulator written in C++. The simulation randomly assigns samples to either group A or group B, with each group having different conversion probabilities. The simulation can calculate both false positive and true positive rates.

Requirements

The project requires the following dependencies to be installed on your system:

  • Bazel: A fast, scalable, and multi-language build system.
  • C++14 or later: This project uses modern C++ features, and you need to have a C++14 or later compatible compiler.
  • Boost: Required for using gamma distribution for statistical calculations. This is included as a build dependency, so there is no need to install Boost on your system.

Building

To build the project, navigate to the directory where the code is located and run:

bazel build main

Testing

We have a number of tests to verify the correctness of the program. Run the tests with the following command:

bazel test --cxxopt=-std=c++14 --test_output=all $(bazel query //...)

Usage

After building, you can run the program using the binary generated by Bazel. This program will run a simulation and print both the false positive rate and the true positive rate for the given parameters.

License

This project is licensed under the MIT License.