Design Experiment
Design statistically sound A/B experiments that produce trustworthy causal evidence for product decisions.
Why This Is Best Practice
Adopted by: Microsoft (ExP platform, Kohavi's team), Google, Netflix, Airbnb — all maintain internal experimentation platforms
Impact: Kohavi et al. report that only 1/3 of A/B experiments at Microsoft produce a positive result; without rigorous experiment design, teams ship features that feel successful but have no causal impact or actively harm metrics.
Why best: A/B testing is the only method that provides causal evidence in product development. Without it, correlation-based decisions (feature launched, DAU went up — success!) fail to account for confounders. Trustworthy experiments require pre-registration of hypotheses, power analysis, and fixed analysis windows.
Steps
- Define the hypothesis — Write a falsifiable hypothesis: "Changing X will increase metric Y by Z% because [mechanism]." Define primary metric (OEC — Overall Evaluation Criterion) before running.
- Select guardrail metrics — Identify metrics that must not regress (e.g., latency, error rate, revenue) even if the primary metric improves.
- Run a power analysis — Calculate required sample size: specify minimum detectable effect (MDE), significance level α=0.05, power 1-β=0.80. Use a power calculator (e.g.,
pwr in R, statsmodels in Python). Do not start the test without sufficient sample size.
- Randomize correctly — Randomize at the user level (not session or request) to avoid carryover effects. Use a consistent hash of user ID + experiment ID for deterministic assignment.
- Run the experiment for the pre-determined duration — Never stop early based on results (peeking). Run for at least one full business cycle (typically 1-2 weeks) to account for day-of-week effects.
- Analyze with the pre-registered method — Apply t-test or Mann-Whitney U; report p-value, confidence interval, and effect size. Check for SRM (Sample Ratio Mismatch) first — if control/treatment ratio deviates >5% from target, the experiment is invalid.
- Document and share results — Record hypothesis, methodology, results (including null results), and decision. Null results are valuable — they prevent re-running the same failed experiment.
Rules
- Never change the experiment while it is running — adds confounders that invalidate results.
- Ship only if the primary metric improves AND no guardrail metrics regress significantly.
- Publish null results — a well-run experiment that shows no effect is a valid and valuable outcome.
- Avoid running multiple overlapping experiments on the same users without interaction analysis.
Examples
Hypothesis: Adding social proof ("1,200 users bought this today") to the product page will increase add-to-cart rate by 5%.
OEC: Add-to-cart rate. Guardrail: Page load time P95, return rate.
MDE: 5%, α=0.05, power=0.80 → required n=8,400 per variant → 2 weeks at current traffic.
Result: +3.2% (95% CI: [1.1%, 5.3%], p=0.003). Ship.
Common Mistakes
- Peeking and stopping early — inflates false positive rate; at α=0.05, peeking 5× gives a true false-positive rate of ~19%.
- No power analysis — underpowered experiments produce inconclusive results and waste traffic.
- Using page views as the unit of randomization — same user sees both variants; violates stable unit treatment value assumption (SUTVA).
When NOT to Use
- When daily active users are too low to reach the required sample size within a reasonable time window, running the experiment will produce underpowered, inconclusive results regardless of how long it runs.
- When the change being evaluated is a critical security patch, compliance fix, or regression repair, ethical and legal obligations require shipping immediately rather than exposing a control group to a known defect.
- When the product surface has strong network effects between users (e.g., social feeds, multiplayer features), user-level randomization creates interference between variants that invalidates the causal assumption underpinning the experiment.
1---2name: design-experiment3description: Use when designing an A/B test or online controlled experiment to evaluate a product change4source: Kohavi, Tang & Xu "Trustworthy Online Controlled Experiments" (Cambridge University Press 2020); Evan Miller "How Not To Run an A/B Test" (evanmiller.org)5tags: [experimentation, ab-testing, statistics, product, data-science, hypothesis-testing]6verified: true7metadata:8 source: https://skillmd.com/skills/jeffreytse/design-experiment9---1011# Design Experiment1213Design statistically sound A/B experiments that produce trustworthy causal evidence for product decisions.1415## Why This Is Best Practice1617**Adopted by:** Microsoft (ExP platform, Kohavi's team), Google, Netflix, Airbnb — all maintain internal experimentation platforms18**Impact:** Kohavi et al. report that only 1/3 of A/B experiments at Microsoft produce a positive result; without rigorous experiment design, teams ship features that feel successful but have no causal impact or actively harm metrics.1920**Why best:** A/B testing is the only method that provides causal evidence in product development. Without it, correlation-based decisions (feature launched, DAU went up — success!) fail to account for confounders. Trustworthy experiments require pre-registration of hypotheses, power analysis, and fixed analysis windows.2122## Steps23241. **Define the hypothesis** — Write a falsifiable hypothesis: "Changing X will increase metric Y by Z% because [mechanism]." Define primary metric (OEC — Overall Evaluation Criterion) before running.252. **Select guardrail metrics** — Identify metrics that must not regress (e.g., latency, error rate, revenue) even if the primary metric improves.263. **Run a power analysis** — Calculate required sample size: specify minimum detectable effect (MDE), significance level α=0.05, power 1-β=0.80. Use a power calculator (e.g., `pwr` in R, `statsmodels` in Python). Do not start the test without sufficient sample size.274. **Randomize correctly** — Randomize at the user level (not session or request) to avoid carryover effects. Use a consistent hash of user ID + experiment ID for deterministic assignment.285. **Run the experiment for the pre-determined duration** — Never stop early based on results (peeking). Run for at least one full business cycle (typically 1-2 weeks) to account for day-of-week effects.296. **Analyze with the pre-registered method** — Apply t-test or Mann-Whitney U; report p-value, confidence interval, and effect size. Check for SRM (Sample Ratio Mismatch) first — if control/treatment ratio deviates >5% from target, the experiment is invalid.307. **Document and share results** — Record hypothesis, methodology, results (including null results), and decision. Null results are valuable — they prevent re-running the same failed experiment.3132## Rules3334- Never change the experiment while it is running — adds confounders that invalidate results.35- Ship only if the primary metric improves AND no guardrail metrics regress significantly.36- Publish null results — a well-run experiment that shows no effect is a valid and valuable outcome.37- Avoid running multiple overlapping experiments on the same users without interaction analysis.3839## Examples4041Hypothesis: Adding social proof ("1,200 users bought this today") to the product page will increase add-to-cart rate by 5%.42OEC: Add-to-cart rate. Guardrail: Page load time P95, return rate.43MDE: 5%, α=0.05, power=0.80 → required n=8,400 per variant → 2 weeks at current traffic.44Result: +3.2% (95% CI: [1.1%, 5.3%], p=0.003). Ship.4546## Common Mistakes4748- **Peeking and stopping early** — inflates false positive rate; at α=0.05, peeking 5× gives a true false-positive rate of ~19%.49- **No power analysis** — underpowered experiments produce inconclusive results and waste traffic.50- **Using page views as the unit of randomization** — same user sees both variants; violates stable unit treatment value assumption (SUTVA).5152## When NOT to Use5354- When daily active users are too low to reach the required sample size within a reasonable time window, running the experiment will produce underpowered, inconclusive results regardless of how long it runs.55- When the change being evaluated is a critical security patch, compliance fix, or regression repair, ethical and legal obligations require shipping immediately rather than exposing a control group to a known defect.56- When the product surface has strong network effects between users (e.g., social feeds, multiplayer features), user-level randomization creates interference between variants that invalidates the causal assumption underpinning the experiment.