Sub topic 7
Writing the experiment brief
What the brief is and why it exists
An experiment brief is a one-page plan that product, engineering and data agree on before launch. It records what you will test, who is in the test, what you will measure, how many users you need, and what you will do with each possible result.
This chapter assumes you can already write a testable hypothesis, choose a primary metric and guardrail metrics, pick a randomization unit, and estimate a sample size. The brief collects those decisions in one place.
A brief does three jobs:
- Alignment. Engineering knows exactly what to build and log. Data knows exactly what to analyze.
- Protection against hindsight. Once you see results, it is tempting to switch the primary metric or the decision threshold. A brief written beforehand makes such changes visible.
- Memory. Months later, someone can read the brief and the result and understand what was learned without asking the original team.
Required sections
Every brief needs the sections below. Each section has an owner, but all three functions review the whole document.
| Section | What it contains | Usual owner |
|---|---|---|
| Context and hypothesis | The problem, the change, the expected effect and the reason | Product |
| Eligibility and unit | Who can enter the test and what is randomized | Product with data |
| Variants and split | What each group sees and the traffic percentages | Product with engineering |
| Metrics | One primary metric, guardrails, and secondary metrics with exact definitions | Data with product |
| Sample size and duration | Baseline, minimum detectable effect, alpha, power, users per variant, run time | Data |
| Instrumentation | Events and properties that must be logged, and how exposure is recorded | Engineering with data |
| Launch and monitoring | Ramp plan, health checks, stop conditions | Engineering with data |
| Decision rule | What result leads to ship, iterate or stop | Product, signed off by data |
A worked brief
The YAML below is a compact version of the brief for a checkout address-autofill test. YAML is a plain-text format of nested keys and values, so it is easy to review in a pull request and easy to read by a script.
experiment: checkout_address_autofill
owner: product
engineering_contact: eng-checkout
data_contact: analytics-growth
hypothesis: >
If we autofill saved addresses at checkout, then more users will
complete purchase, because fewer form fields reduce friction.
randomization_unit: user_id
eligibility: logged-in users on web with at least one saved address
variants:
control: 50
treatment: 50
primary_metric:
name: checkout_completion_rate
baseline: 0.10
minimum_detectable_effect_abs: 0.01
guardrail_metrics:
- payment_error_rate
- page_load_time_p95
planned_sample_per_variant: 14750
alpha: 0.05
power: 0.8
decision_rule: >
Ship if the primary metric's confidence interval is above zero
and no guardrail shows a meaningful regression.Read it as a contract. The hypothesis names the change, the expected effect and the mechanism. The eligibility line says who counts. The unit is user_id, so one person sees one variant on every visit. The primary metric has a baseline and a minimum detectable effect, which are the inputs to the sample size. The decision rule is written before any data exists.
Deriving the numbers in the brief
Data should be able to show how planned_sample_per_variant was calculated. The function below uses the normal approximation for two proportions.
import math
from statistics import NormalDist
def sample_size_per_variant(baseline, mde_abs, alpha=0.05, power=0.8):
"""Approximate users per variant for a two-sided test of two proportions."""
p1 = baseline
p2 = baseline + mde_abs
z = NormalDist().inv_cdf
z_alpha = z(1 - alpha / 2)
z_beta = z(power)
variance = p1 * (1 - p1) + p2 * (1 - p2)
return math.ceil((z_alpha + z_beta) ** 2 * variance / (p2 - p1) ** 2)
# Baseline 10% conversion, detect an absolute lift of 1 percentage point.
print(sample_size_per_variant(0.10, 0.01))The result is about 14,750 users per variant, which is the figure in the brief. The two variants together need roughly 29,500 users.
Turn that into a duration by dividing by the number of eligible users who reach the experiment each day. If 2,500 eligible users arrive daily, 29,500 users take about 12 days. Round up to whole weeks, here 14 days, so that every day of the week appears equally often. Weekday and weekend behavior often differs, and a partial week skews the comparison.
The brief should also say what happens if traffic is lower than expected. Either extend the run to the planned sample, or accept a larger minimum detectable effect. Decide this now, not when the results look borderline.
Writing each section well
Context and hypothesis
State the evidence behind the idea, such as funnel data, support tickets or research, in a few sentences. Then use the "If we..., then..., because..." form. The "because" matters. If the test fails, it tells you which belief was wrong.
Eligibility and unit
Write eligibility as a rule an engineer can implement, not as a description. "Logged-in users on web with at least one saved address" can be turned into a condition in code. "Engaged users" cannot. Also state when eligibility is evaluated. Users should enter the experiment at the moment they would first see the change, not at login, or the control group fills with users who never reach the feature and dilutes the effect.
Metrics
Give each metric a precise definition: the numerator, the denominator, the time window and the population. For example, checkout_completion_rate is the share of eligible users who start checkout and complete an order within 24 hours of first exposure. Name one primary metric. Guardrails are metrics that must not get worse, such as payment errors and page load time. Secondary metrics help explain the result but do not decide it.
Decision rule
A good rule covers every outcome, not just success. A table works well:
| Result | Action |
|---|---|
| Interval for the primary metric entirely above zero, guardrails stable | Ship to 100% |
| Interval includes zero, and the lower bound excludes your smallest worthwhile effect | Stop and record the learning |
| Interval includes zero and is too wide to rule out a worthwhile effect | Iterate or extend, with a new brief |
| Any guardrail shows a meaningful regression | Do not ship, investigate |
Define "meaningful regression" with a number, such as "payment error rate rises by more than 0.2 percentage points".
How the brief is reviewed
Review is a short meeting or a comment thread, not a ceremony. Data checks that the sample size follows from the stated inputs and that the metric can be computed from the logged events. Engineering checks that the eligibility rule, the assignment and the events are feasible in the planned timeframe. Product checks that the decision rule matches the business decision that will follow.
Handling changes after launch
Sometimes the plan has to change. A logging bug may require a restart, or traffic may be lower than assumed. Do not edit the original text quietly. Add a dated amendment that states what changed, why, and whether any results had been seen. A change made before anyone looked at outcome data is usually harmless. A change made after looking weakens the result, and the analysis should say so.
If you change the hypothesis, primary metric or unit, treat it as a new experiment with a new brief and a fresh start date. Data collected under the old plan should not be pooled with it.
Common errors
- Several primary metrics. With many "primary" metrics, some will look significant by chance. Choose one, and list the others as secondary.
- Vague metric names. "Conversion" can mean five things. Write the formula.
- No baseline source. State where the baseline came from and which period it covers. A baseline from a holiday month will mislead.
- Minimum detectable effect chosen to fit the schedule. The effect should be the smallest change worth acting on, not the one that makes the test finish quickly.
- Decision rule written only for success. If a flat result has no planned action, the team will argue about it after the fact.
- Brief written after launch. It then documents what happened instead of constraining it.
Checklist before sign-off
- The hypothesis states the change, the effect and the reason.
- Eligibility and the randomization unit can be implemented as written.
- There is one primary metric, and every metric has a formula and a time window.
- The sample size can be reproduced from the baseline, minimum detectable effect, alpha and power.
- The run length is in whole weeks and a fallback exists for low traffic.
- Required events and the exposure log are listed for engineering.
- The decision rule covers success, flat results and guardrail regressions.
- Product, engineering and data have each approved the document.
Exercise
A teammate drafts a brief for a new onboarding flow. It lists "activation" as the primary metric with no definition, a planned run of 10 days, and the decision rule "ship if results look good". Name three problems and say how you would fix each.
Show answer
First, "activation" has no definition. Fix it by writing the formula: the numerator event, the denominator population and the time window, such as "share of new eligible users who complete setup within 7 days of first exposure". Second, 10 days is not a whole number of weeks, so weekday and weekend behavior is unevenly represented. Fix it by rounding the run up to 14 days, after checking that the planned sample size is reached. Third, "ship if results look good" is not a decision rule. Fix it by stating a threshold on the confidence interval for the primary metric, a numeric limit for each guardrail regression, and the action for a flat result, such as stop and record the learning or iterate with a new brief.