intermediateadvanced-statistics

A/B Testing

The structured way companies test whether a change actually works — or just feels like it does.

Key Points

What it is

An A/B test is a controlled experiment where you randomly split users into two groups, show each group a different version of something, and measure which performs better. Group A gets the current version (control). Group B gets the changed version (treatment). Statistics then tells you whether any difference you observe is real or just random noise.

Why it exists

Our intuition about what will work is frequently wrong. A redesigned button that looks better to the designer might perform worse for users. A clunkier checkout flow might actually increase conversions. A/B testing is the antidote to HiPPO decisions — Highest Paid Person's Opinion. It lets data decide instead of gut feel.

Intuition

Imagine a restaurant wants to know if a new menu layout increases orders of the daily special. Option 1: just switch the menu and see if specials sales go up. But what if sales went up because of a local event that week? Or a competitor closed? You can't separate the menu effect from everything else happening at the same time. Option 2: on the same day, half the tables get the new menu and half get the old one. Tables are assigned randomly. Now everything else is the same — the only difference is the menu. Any sales difference between the two groups has to be because of the menu. That isolation of cause is what an A/B test gives you.

How it works

  1. Define the hypothesis

    Be specific. Not 'will the new button perform better?' but 'will changing the CTA button from grey to orange increase clicks by at least 5%?' Name your primary metric. Name your minimum detectable effect.

  2. Run a power calculation

    Based on your baseline conversion rate, minimum detectable effect, alpha (typically 0.05), and target power (typically 0.80) — calculate the minimum sample size per group. This tells you how long to run the test.

  3. Randomise assignment

    Every user must be randomly assigned to control or treatment — not by device type, not by signup date, not by country. Random. Consistent (same user always sees the same variant).

  4. Run the test for the pre-specified duration

    Don't peek and stop early. Don't extend when you're close. Commit to the sample size you calculated. This is the hardest part in practice.

  5. Analyse the result

    Run your chosen statistical test (usually a two-proportion z-test for conversion rates). Check p-value against alpha. Then check effect size — is the lift large enough to matter? Then ship or don't.

When to use

When not to use

Common mistakes

Notes

In practice

A/B testing is the backbone of product development at tech companies. Google runs thousands simultaneously. The data science role includes: designing the experiment, calculating required sample sizes, monitoring for data quality issues (SRM — sample ratio mismatch), running the statistical analysis, and communicating results. Tools: Optimizely, LaunchDarkly, Statsig, and custom internal experimentation platforms.

Was this concept helpful?

Spot an error or gap? Suggest an edit →

Related concepts

hypothesis-testingstatistical-powereffect-sizetype-1-type-2-errorsmultiple-testing-problembayesian-thinking
Chirp at me!