A/B Test Plan Template
Pre-registered A/B test: hypothesis, randomisation unit, metrics, Lehr sample size, SRM and peeking rules, novelty, privacy and consent, decision rule, results
उपयोग कैसे करें: Use it before exposing any user to an experiment. Fill the hypothesis, primary metric, sample size and decision rule first and get them approved. The main pitfall is peeking and stopping early, or skipping the sample ratio mismatch check.
प्रीव्यू
Experiment Plan: [feature / change]
A pre-registered plan for one online controlled experiment (A/B test): hypothesis, randomisation unit, metrics, sample size, duration, trust checks, decision rule and results. Write and approve it before the experiment starts; decide the success criteria before looking at the data, or you will rationalise whatever you see. Practice follows Kohavi, Tang and Xu, Trustworthy Online Controlled Experiments (Cambridge University Press, 2020) and Lehr's sample size rule of thumb (1992). Replace every
[bracketed]value and every row marked Example. The privacy section is a documentation aid, not legal advice.
Document control
| Field | Value |
|---|---|
| Experiment ID | [EXP-NNN] |
| Experiment name | [Short descriptive name] |
| Version | [0.1] |
| Status | [Design / Approved / Running / Analysing / Decided] |
| Owner | [@product-manager] |
| Analyst | [@analyst] |
| Engineering contact | [@engineer] |
| Approvers / reviewers | [@product-lead, @data-lead, @privacy-contact] |
| Planned start | YYYY-MM-DD |
| Planned end | YYYY-MM-DD |
| Last updated | YYYY-MM-DD |
| Classification | [Internal] |
Approvals
| Role | Name | Decision | Date |
|---|---|---|---|
| Product lead | [@name] | [Approved / Changes requested] | YYYY-MM-DD |
| Data or analytics lead | [@name] | [Approved / Changes requested] | YYYY-MM-DD |
| Privacy contact | [@name] | [Approved / Changes requested] | YYYY-MM-DD |
Revision history
| Version | Date | Author | Change |
|---|---|---|---|
| 0.1 | YYYY-MM-DD | [@owner] | First draft of the plan |
| [1.0] | YYYY-MM-DD | [@owner] | [Approved before launch; plan frozen] |
| [1.1] | YYYY-MM-DD | [@analyst] | [Results and decision added] |
1. Hypothesis
We believe [change] will cause [primary metric] to [increase / decrease] by at least [minimum effect] for [population] because [mechanism, grounded in research or data].
Example: We believe replacing the empty first screen with a three-step template picker will raise seven-day activation (a new account creates and saves a second note within seven days) from 20% to at least 22% for new web sign-ups, because interview research (RES-031) showed that new users do not know what to write first.
Null hypothesis: the change has no effect on the primary metric. Alternative: the change moves it in either direction (two-sided test). A two-sided test is the safe default because a change can also hurt.
2. Variants and randomisation
| Variant | Change | Allocation |
|---|---|---|
| Control | [Current experience] | [50%] |
| Treatment A | [Change] | [50%] |
| Example: Control | Empty first screen | 50% |
| Example: Treatment A | Three-step template picker on first screen | 50% |
| Design decision | Value |
|---|---|
| Randomisation unit | [User account / device / session / page view] Example: user account |
| Analysis unit | [Same as randomisation unit, or state the correction used] Example: user account |
| Assignment method | [Deterministic hash of unit ID and experiment salt] |
| Assignment point | [Example: at first page view after sign-up, before the first screen renders] |
| Exposure logging | [Example: event experiment_exposed with experiment ID and variant] |
| Interference risk | [Example: low; notes are private, no network effects between users] |
| Concurrent experiments | [List overlapping tests and whether they share users] |
Questions to answer before launch:
- Does a user always see the same variant across devices and sessions?
- Are users counted from the moment of assignment, not only if they reach the changed screen (to avoid a biased "triggered" population)?
- If the unit is a session or page view but the metric is per user, how will you correct the variance (for example the delta method)?
- Could users in different arms affect each other (shared documents, marketplaces, social features)? If yes, consider cluster randomisation.
3. Population and exclusions
- Included: [population]. Example: new accounts created on the web app in the test window, all regions where the app is offered.
- Excluded: [internal staff accounts, test accounts, known bots, users who opted out of experiments].
- Pre-declared subgroups: [list, with the reason each matters]. Example: desktop versus mobile web; users who arrived from the template gallery versus from search.
Subgroup results are exploratory unless the plan sized the experiment for them. Report them, but do not ship on a subgroup win when the overall result is flat.
4. Metrics
| ID | Type | Metric | Definition link | Direction | Threshold |
|---|---|---|---|---|---|
| M-1 | Primary | [Metric] | [link] | [up / down] | [minimum effect] |
| M-2 | Guardrail | [Metric] | [link] | [no worse than] | [tolerance] |
| M-3 | Diagnostic | [Metric] | [link] | informational | n/a |
| M-1 (Example) | Primary | Seven-day activation rate | MET-007 | up | at least +2.0 percentage points |
| M-2 (Example) | Guardrail | Support tickets per 1,000 new accounts | MET-012 | no worse than | +10% relative |
| M-3 (Example) | Guardrail | First-screen load time, 75th percentile | MET-020 | no worse than | +100 ms |
| M-4 (Example) | Diagnostic | Template picker click-through | MET-031 | informational | n/a |
Define metrics in Metric Definition (data/metric-definition) and the
events behind them in the Analytics Tracking Plan
(data/analytics-tracking-plan).
5. Sample size and duration
Inputs:
- Baseline value of the primary metric: [N%]
- Minimum detectable effect (absolute): [delta]
- Significance level: two-sided alpha = [0.05]
- Power: [80%]
- Eligible traffic per day: [N units]
Quick estimate with Lehr's rule (Lehr, 1992), per arm, for two equal arms:
deltais the absolute difference you want to detect.sigma^2is the variance of the metric. For a rate (proportion), usep(1 - p)wherepis the average of the baseline and the target rate.- The constant 16 is valid only for a two-sided alpha of 0.05 and 80% power: it rounds 2 x (1.96 + 0.84)^2, which is about 15.7. For 90% power the constant is about 21. For other designs (unequal arms, more than two arms, ratio metrics), use a proper power calculation.
Example: baseline 20%, target 22%, so p = 0.21 and sigma^2 = 0.21 x
0.79 = 0.1659. With delta = 0.02, n = 16 x 0.1659 / 0.0004 = 6,636 new
accounts per arm, 13,272 in total. At 1,000 eligible sign-ups per day,
split 50/50, that is 13.3 days, rounded up to 14 days (two full
weeks). The exact normal-approximation formula for two proportions
(variance 0.20 x 0.80 and 0.22 x 0.78 in the arms) gives about 6,510 per
arm, so the rule of thumb is slightly conservative here.
| Item | Value |
|---|---|
| Required sample per arm | [N] |
| Expected duration | [N days, whole weeks] |
| Planned end date | YYYY-MM-DD |
| Example: required sample per arm | 6,636 accounts |
| Example: expected duration | 14 days |
6. Trust checks and analysis rules
6.1 Sample ratio mismatch (SRM). Compare the observed count per arm with the planned allocation using a chi-square goodness-of-fit test. If the p-value is below the agreed threshold [for example 0.001], stop the analysis: assignment or logging is broken and the metric results cannot be trusted until the cause is found.
Example: control 7,050 and treatment 6,950 accounts against an expected 7,000 each gives chi-square = 0.71 with 1 degree of freedom, p = 0.40: no mismatch.
6.2 A/A or pre-period check. [Run an A/A test on the same assignment code, or compare the arms on a pre-experiment metric, to confirm that the pipeline does not produce false differences.]
6.3 No peeking. This plan uses a fixed horizon: the primary metric is tested once, at the planned end. Dashboards may be watched for guardrail breaches and bugs, but the experiment is not stopped early because the primary metric looks good. If early stopping for success is needed, name a sequential method here before launch [for example a group sequential design with an alpha spending function], with its planned looks.
6.4 Novelty and primacy effects. Users may click a new element because it is new, or resist it because it is unfamiliar. Plot the treatment effect by day and by exposure cohort. If the effect decays steadily, extend the run or plan a holdout before shipping.
6.5 Multiple comparisons. With more than one treatment arm, or more than one primary metric, adjust the significance level [for example Holm or Bonferroni] and state which.
6.6 Analysis method. [Example: difference in proportions with a 95% confidence interval (normal approximation); guardrails tested one-sided against their tolerance.]
7. Privacy, consent and ethics
Rules on storing or reading identifiers on a user's device, and on processing personal data, differ by jurisdiction. Examples, as of October 2026 (check the current official text):
- EU: Article 5(3) of the ePrivacy Directive (2002/58/EC) requires consent for storing or accessing information on a user's device unless it is strictly necessary for a service the user requested. The EDPB Guidelines 2/2023 (version 2.0, 16 October 2024) explain its technical scope. Processing of personal data also falls under the GDPR.
- UK: the Data (Use and Access) Act 2025 (section 112 and Schedule 12) added exceptions to the PECR consent rule, in force from 5 February 2026 as reported by law firm commentary (check legislation.gov.uk). ICO guidance on storage and access technologies lists splitting users into two groups to compare website versions as likely to fit the statistical purposes exception, if information is aggregate, users get clear information and a free, simple way to object, and the data is used only to improve the service.
- US: there is no single federal cookie rule; state privacy laws (for example in California) set notice and opt-out duties.
Questions for the privacy contact:
- Which identifier assigns the variant, and is it stored on the device? Does the consent banner or notice cover it?
- Are users who refused analytics consent excluded or served the control experience without tracking?
- Is a data protection impact assessment needed (see
compliance/dpia)? - Does any arm change price, eligibility, or safety-relevant information? If so, record the ethics review and who approved it.
- How long is experiment-level data retained after the decision?
8. Decision rule
| Outcome | Action |
|---|---|
| SRM or other trust check fails | Discard the result, fix the cause, rerun |
| Any guardrail breached | Stop, revert, investigate |
| Primary up, confidence interval excludes zero, guardrails within tolerance | Ship the variant |
| Primary interval includes zero, guardrails fine | Do not ship; record the learning; decide whether a larger test is worth it |
| Primary down | Revert; record the learning |
9. Results (fill after the planned end)
| Variant | Units | Primary metric | Guardrails | Verdict |
|---|---|---|---|---|
| Control | [N] | [value] | [values] | |
| Treatment A | [N] | [value] | [values] | [Ship / Do not ship / Rerun] |
| Example: Control | 7,050 | 1,410 activated (20.0%) | Tickets 4.1 per 1,000; load p75 820 ms | Baseline |
| Example: Treatment A | 6,950 | 1,536 activated (22.1%) | Tickets 4.3 per 1,000; load p75 860 ms | Ship |
Example: difference +2.1 percentage points, 95% confidence interval +0.8 to +3.5 points (z = 3.05, two-sided p = 0.002). Both guardrails stayed within tolerance (+4.9% tickets against +10%; +40 ms against +100 ms). The daily effect did not decay over the two weeks.
Deviations from the plan: [none / describe].
10. Learnings
- What this changes in the roadmap: [link to
product/roadmapitem] - What we learned about users: [insight]
- Follow-up experiments: [EXP-NNN]
Related templates: Product Launch Checklist (product/launch-checklist),
Prioritization (product/prioritization).
11. References
- Kohavi, R., Tang, D., Xu, Y. (2020). Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing. Cambridge University Press. https://doi.org/10.1017/9781108653985 (chapter 21 covers sample ratio mismatch and trust-related guardrail metrics).
- Lehr, R. (1992). "Sixteen S-squared over D-squared: a relation for crude sample size estimates". Statistics in Medicine, 11(8), 1099-1102. https://doi.org/10.1002/sim.4780110811
- van Belle, G. (2008). Statistical Rules of Thumb, 2nd edition. Wiley.
- Directive 2002/58/EC (ePrivacy Directive), Article 5(3): https://eur-lex.europa.eu/eli/dir/2002/58/oj/eng
- EDPB, Guidelines 2/2023 on Technical Scope of Art. 5(3) of ePrivacy Directive, version 2.0 (16 October 2024): https://www.edpb.europa.eu/our-work-tools/our-documents/guidelines/guidelines-22023-technical-scope-art-53-eprivacy-directive_en
- ICO, guidance on the use of storage and access technologies, "What are the exceptions?": https://ico.org.uk/for-organisations/direct-marketing-and-privacy-and-electronic-communications/guidance-on-the-use-of-storage-and-access-technologies/what-are-the-exceptions/
Standard and licence note
Based on published online experimentation practice (Kohavi, Tang and Xu, 2020) and Lehr's published sample size approximation. The legal examples summarise public EU and UK texts as of October 2026 in original words; this is not legal advice, so check the current official text and your privacy contact. The books are cited, not reproduced:
- Official text: Cambridge University Press, purchase or licensed access: https://doi.org/10.1017/9781108653985
- Official text: Wiley, purchase or licensed access: https://www.wiley-vch.de/de/fachgebiete/mathematik-und-statistik/statistical-rules-of-thumb-978-0-470-14448-0
All template text is original. Template licence: MIT.
संबंधित टेम्पलेट
Beta Program Plan Template
Beta programme plan: learning questions, cohorts and size caps, entry criteria, feedback loop, consent and privacy questions, exit criteria, closure
प्रोडक्ट और प्रोजेक्टFeature Sunset Plan Template
Customer-facing feature retirement plan: decision, impact by segment, dated milestones, replacement mapping, data export and deletion, comms sequence, exceptions
प्रोडक्ट और प्रोजेक्टRICE Prioritization Template
RICE scoring (Effort in person-months), ranked commitment vs capacity, WSJF/ICE/Kano/MoSCoW cross-checks, not-doing list, dependencies, re-scoring