A/B Testing & Experimentation

A/B testing is how you find out whether a change actually caused an improvement, rather than guessing. You randomly split users into a control group (current experience) and one or more variants (the change), then compare a metric. Because the split is random, any difference in outcomes can be attributed to the change — making A/B testing the gold standard for causal measurement in product and growth, where opinions and intuition are notoriously unreliable.

The catch is that doing it correctly requires statistical discipline. It's easy to run a test, see a number go up, and ship a change that was actually noise. Understanding significance, power, sample size, and the classic pitfalls (peeking, p-hacking) is what separates real learning from confident self-deception.

TL;DR

Quick Example

The structure of a clean experiment:

How It Works

  1. Hypothesis — a specific, testable prediction ("changing X improves metric Y").
  2. Randomize — assign users to control or variant(s) at random, so the groups are comparable.
  3. Measure — track the primary metric for each group.
  4. Analyze — is the difference statistically significant, or could it be chance?
  5. Decide — ship the winner, discard the loser, or iterate.

Randomization is the magic: it controls for everything else, so the only systematic difference between groups is the change you made.

The Statistics That Matter

⚠️ "The variant is winning after 2 days!" means little if you haven't reached your pre-computed sample size. Early results swing wildly.

Common Pitfalls

Best Practices

Common Mistakes

Stopping the test as soon as it looks significant

Testing without enough traffic

FAQ

How long should I run an A/B test?

Until you reach the sample size you calculated before starting — based on your baseline conversion rate, the minimum effect size worth detecting, and your desired statistical power (commonly 80%) and significance (commonly 95%). Practically, also run for at least one or two full business cycles (usually 1–2 weeks) so day-of-week effects average out. The cardinal sin is stopping early because it "looks" significant — early results swing wildly, and peek-and-stop dramatically inflates false positives. Decide the duration up front and honor it.

What does "statistically significant" actually mean?

It means the difference you observed is unlikely to have occurred by random chance, given a chosen threshold (e.g. p < 0.05 means roughly a 5% chance of seeing this difference if there were truly no effect). It is not proof the effect is real, large, or important — it's a risk level for one type of error. A significant result with a tiny effect may not be worth shipping, and an underpowered test can miss a real effect entirely. Pair significance with effect size and confidence intervals for a complete picture.

What is p-hacking and how do I avoid it?

P-hacking is torturing the data until it confesses — slicing by segments, trying many metrics, or stopping at a convenient moment until something crosses the significance threshold. Because random noise will occasionally look significant, this manufactures false "wins." Avoid it by pre-registering your hypothesis and a single primary metric before running, computing sample size in advance, running the full planned duration, and correcting for multiple comparisons when you do look at several metrics. Discipline about deciding what you'll measure before you see the data is the core defense.

How is A/B testing different from just shipping and watching the metric?

Shipping and watching is a before/after comparison, which is confounded by everything else that changes over time — seasonality, marketing, other releases, news events. You can't tell whether the metric moved because of your change or something unrelated. A/B testing runs control and variant simultaneously with random assignment, so both groups experience the same external conditions and the only systematic difference is your change. That's what makes the result causal rather than correlational. It's more rigorous precisely because randomization removes the confounds a simple before/after can't.

Related Topics

References