Optimizing A/B tests: a unified template and a DIY toolkit for analysts

Nikolay Polushkin, Mark4 Jul 2024

Problem

Sravni runs A/B tests in 13 products, and about 40 analysts own the tests, their correctness and results. Each analyst planned experiments, calculated sample sizes and chose statistical tests in their own way. Analysis took anywhere from one hour to two days, so the business could not predict timelines. Results lived in team-specific places or in a corporate messenger, and nobody could easily see what a neighboring product had tested.

Example from the article: two similar tests in two teams, one analyzed in a couple of hours and the other in several days.

Solution in brief

The team fixed one process: a Confluence checklist with detailed side documentation, and one pre-filled template per test that serves as both the checklist and the final write-up. They added a Python notebook that builds SQL from widgets and runs statistical tests on any dataframe, by day and by segment. A year later about two thirds of the analysts used the script.

Questions this case answers
  • How to standardize experiment planning, analysis and documentation across many analysts of different skill levels, so that test correctness does not depend on who runs it
  • How to build a minimal, extensible notebook tool that runs several statistical tests on arbitrary experiment data, cumulatively over time and by segment
  • How to make about 40 analysts in 13 products plan, run and document A/B tests the same way?
  • How to cut the time an analyst spends on the statistical analysis of an A/B test?

Tools and methods

  • Confluence — the checklist, the pre-filled result template and the explanatory documentation
  • Polars — the dataframe engine of the A/B tester class, chosen for speed over Pandas
  • Student's t-test — the main criterion, with a p-value over time
  • Bootstrap test — a check when the t-test result is in doubt
  • MDE and lift charts — a sanity check on whether the observed effect reaches the detectable one
Continue reading — it's free

Google or a one-time email code. No password.