Sub topic 3
Writing a testable hypothesis
A hypothesis is the claim your experiment is built to confirm or refute. If the claim is vague, every later choice (metric, unit, sample size, decision) becomes a negotiation after the data arrives. This chapter shows how to write one that engineering and data can act on.
Prerequisites assumed: you know basic product vocabulary (features, funnels, KPIs), you are comfortable with proportions and percentages, and you know what a feature flag is. The code is short and readable without Python expertise.
What a testable hypothesis contains
A testable hypothesis ties a specific change to a specific, measurable outcome and gives a reason. A useful template has four parts:
- Change: what you will do differently for treated users.
- Population: who is affected.
- Expected effect: which metric moves, in which direction, and by roughly how much.
- Mechanism: why you believe it will happen.
The common form is: "If we [change], then [metric] will [direction] for [population], because [mechanism]."
The experiment brief from the topic plan uses this form:
hypothesis: >
If we autofill saved addresses at checkout, then more users will
complete purchase, because fewer form fields reduce friction.The mechanism clause matters because it tells you what else should be true. If fewer fields reduce friction, you would expect time on the address step to drop, and you would expect the effect to be larger for users who have a saved address. These secondary predictions help you interpret a surprising result later.
Falsifiable versus vague
A hypothesis is falsifiable if some possible result would show it to be wrong. Compare these:
| Statement | Problem | Better version |
|---|---|---|
| "The new checkout is better." | "Better" is undefined, so any result can be called a win. | "The new checkout raises checkout completion rate." |
| "Autofill will improve the experience." | Experience is not a metric. | "Autofill will raise completion rate by at least 1 percentage point." |
| "Users will like the redesign." | No metric, no population, no direction. | "The redesign will raise 7-day return rate among new users." |
| "We should add recommendations." | This is a solution, not a claim. | "If we show related items on the cart page, average items per order will rise, because users discover items they would otherwise miss." |
Two tests help you check a draft. First, ask: "What result would make me say we were wrong?" If you cannot answer, the hypothesis is not testable. Second, ask: "Could two people read this and compute the same metric?" If not, it is not specific enough.
Directional, with a minimum effect
State a direction before you see data. A hypothesis that says "completion rate will change" invites you to celebrate a drop as a finding. A directional hypothesis also gives the data team the right test setup and keeps the decision rule honest.
Add a size as well. The minimum detectable effect (MDE) is the smallest true change you care about and want the experiment to be able to detect. It comes from business value, not from what is convenient to measure. Ask: "What lift would justify the engineering and maintenance cost of this change?" If the answer is a one-point lift on a 10% baseline, your MDE is 0.01 in absolute terms. The next chapters use the MDE to size the experiment, so it needs to be in the hypothesis from the start.
Be careful to say whether an effect is absolute or relative. A one-point lift on a 10% baseline is an absolute change of 0.01 and a relative change of 10%. Mixing the two is a frequent source of confusion between product and data.
baseline = 0.10
absolute_lift = 0.01
relative_lift = absolute_lift / baseline
print(f"absolute: {absolute_lift:.2%}, relative: {relative_lift:.0%}")This prints absolute: 1.00%, relative: 10%. Write the one you mean, with the units, every time.
Null and alternative hypotheses
Statisticians restate your product hypothesis as a pair of formal claims. You do not need to write these in the brief, but you should understand them because they determine how results are read.
- Null hypothesis (H0): the change has no effect. The true difference in the metric is zero.
- Alternative hypothesis (H1): the change has an effect. The true difference is not zero (two-sided) or is greater than zero (one-sided).
The experiment does not prove H1. It asks whether the data would be surprising if H0 were true. Chapter "Reading results" covers p-values and intervals. For now, note that your product hypothesis maps to H1, and your job in writing it is to make H1 precise enough to test.
Most product teams use a two-sided test even when they expect improvement, because a harmful effect is also important information. The sample size example in the brief uses a two-sided alpha of 0.05 for that reason.
Choosing the metric that carries the hypothesis
Each hypothesis should name exactly one primary metric, the measure that decides the outcome. If you name three, you have created a multiple comparison problem and given yourself room to pick the favorable one after the fact.
Pick a primary metric that:
- is close to the change, so the effect is large enough to detect. Autofill affects checkout completion more directly than quarterly revenue.
- is sensitive, meaning it moves when the change works and has modest noise.
- reflects value, so improving it is worth doing.
- is measurable within the experiment window. A 90-day retention metric cannot decide a two-week test.
Also name the guardrail metrics that must not regress, such as payment error rate or page load time. Guardrails are part of the hypothesis in a practical sense: "Completion rises and nothing important breaks." Writing them now prevents a late debate about what counts as harm.
Hypotheses that come from evidence
A strong hypothesis rests on an observation. Good sources include funnel analysis showing a drop-off step, session recordings, support tickets, user interviews, and results of earlier experiments. Record the evidence next to the hypothesis. It helps reviewers judge whether the mechanism is plausible, and it helps your future self understand why the idea was tried.
A weak hypothesis rests on preference, such as "the competitor has it." That may justify building a feature, but it does not tell you what metric should move or why.
A worked example
Suppose analytics shows that 38% of users who reach the address step abandon it, and interviews mention tedious typing. You draft:
> Draft 1: "Autofill will make checkout easier."
This fails both tests above. You refine it step by step.
- Add the change and population. "Showing saved addresses pre-filled at checkout, for logged-in web users with at least one saved address."
- Add the metric and direction. "Checkout completion rate will increase."
- Add the size. "By at least 1 percentage point from a 10% baseline."
- Add the mechanism. "Because fewer form fields reduce friction."
- Add guardrails. "Payment error rate and p95 page load time do not meaningfully worsen."
The final version is the YAML brief you saw earlier. A reader can see what to build, who is included, what to measure and what would count as failure.
You can also write down what you will conclude under each outcome. This is a short table that you agree on before launch:
| Outcome | Interpretation |
|---|---|
| Interval above zero, guardrails stable | Hypothesis supported. Candidate to ship. |
| Interval includes zero, and is narrow around zero | No meaningful effect. Stop or rethink. |
| Interval includes zero, and is wide | Inconclusive. The test lacked precision. |
| Interval below zero | Change hurts. Do not ship. |
Mapping the hypothesis to the plan
The hypothesis drives the other parts of the experiment design. The following diagram shows how.
If a downstream step feels hard, the cause is often an imprecise hypothesis. For example, if the data team cannot choose a randomization unit, check whether the population and metric are defined clearly.
Common mistakes
- Writing a solution as a hypothesis. "We should build X" is a plan. Express the expected outcome instead.
- Several changes in one test. If you change the layout, copy and button color together, you cannot say which caused the effect. Test one idea, or accept that you are testing a bundle and say so.
- No mechanism. Without a reason, you cannot learn from a null result. You will not know whether the idea failed or the execution did.
- Hypothesis written after seeing data. This is called HARKing, hypothesizing after results are known. It makes a chance pattern look like a prediction.
- Metric chosen to be easy to move. Clicks on a button may rise while purchases do not. Choose the metric tied to value.
- Unrealistic effect size. Expecting a 20% lift from a minor copy change leads to an under-sized test. Use past experiments as a guide to what is plausible.
- Ignoring the population. If only 15% of users are eligible, the overall effect is diluted. State who is eligible and measure within that group.
Checklist before you move on
- Is the change described so that engineering could build it without asking questions?
- Is the population stated?
- Is there one primary metric, with a direction and a size (absolute or relative)?
- Are guardrails named?
- Is there a mechanism and a source of evidence?
- Can you say what result would show you were wrong?
Exercise
A teammate proposes this hypothesis: "The new onboarding flow will improve user engagement." Rewrite it as a testable hypothesis for new mobile users, with one primary metric, a minimum effect, a mechanism and one guardrail. State whether your effect size is absolute or relative.
Show answer
One acceptable answer: "If we replace the five-screen onboarding with a two-screen flow for new mobile users, then the share who complete a first project within 7 days will rise by at least 3 percentage points (absolute) from a 20% baseline, because fewer screens reduce drop-off before users reach core value. Guardrail: 30-day uninstall rate does not meaningfully increase." The answer must name a specific primary metric (not "engagement"), a direction, a size labeled absolute or relative, a population, a mechanism and at least one guardrail.
Exercise
A baseline conversion rate is 8%. Your hypothesis expects a lift of 0.8 percentage points. What is this as a relative lift, and why does it matter to write which kind you mean?
Show answer
The relative lift is 0.8 / 8 = 10%. It matters because "10%" and "0.8 points" describe the same change but are easily confused. If the data team reads "10%" as absolute (an 18% rate), they will size the test for a much larger effect and the experiment will be under-powered for the real one.
Exercise
Why should a product hypothesis name a direction and a single primary metric before launch?
Show answer
A stated direction stops a harmful result from being reframed as a finding, and a single primary metric stops the team from choosing whichever of several metrics looks best afterward. Both choices keep the decision rule honest and avoid inflating false positives through multiple comparisons.