Study Design
A/B Testing
Reviewed byMallik Gaddam
Definition
A/B testing is an experimental design that randomly assigns participants or users to one of two variants, labeled A and B, to compare their effects on a predefined outcome.[3] It is widely used across clinical research, behavioral science, and user experience design to isolate the causal effect of a single change while holding all other conditions constant.
Try it yourself
Cause & effectΒ· ~2 min
Same difference, different sample sizes
Goal: See how sample size decides whether a real 3.4-point difference is detectable, and why peeking breaks the test.
A hospital tests two appointment reminders. The true no-show rates are 14.2% for reminder A and 10.8% for reminder B. Change how many patients each group gets and watch what the same 3.4-point difference looks like.
Patients per group
Difference (A β B)
3.4 pts
95% CI
β4.1 to 10.9
p-value
0.47
Power
14%
The interval runs from B being 4 points worse to 11 points better. With 150 per group, a study this size would detect a real 3.4-point effect only about 1 time in 7.
Illustrative figures. The no-show rates are fixed at 14.2% and 10.8% for every sample size, so smaller groups imply fractional patient counts. p-values come from a two-proportion chi-square test with Yates continuity correction; 95% confidence intervals use the normal (Wald) approximation without correction; power is approximate, assuming the true difference is 3.4 points and a two-sided alpha of 0.05.
Why it matters
A/B testing is one of the most accessible and widely trusted methods for establishing causal relationships between an intervention and an outcome. Clinical researchers use it to compare drug formulations or dosing strategies. Behavioral scientists apply it to evaluate nudges, messaging strategies, and educational interventions. Technology companies rely on it to optimize product features, pricing, and interface elements. Because the method randomly assigns participants, it balances both observed and unobserved confounders on average, giving decision makers high confidence that observed differences reflect the true effect of the change rather than background variation.[2][3] Randomized comparisons are widely regarded as the gold standard for generating evidence of cause and effect.[3]
How it works
The process begins with defining a clear primary outcome metric, such as conversion rate, clinical response, or behavioral compliance. Researchers then determine the minimum sample size needed to detect a meaningful difference at a given statistical power, typically 80% or higher, and a chosen alpha level, usually 0.05.[1][3]
Participants are randomly allocated to two groups. Group A receives the control condition, which represents the current standard or baseline, and Group B receives the modified condition, which incorporates the single change being tested. Randomization makes the groups comparable at baseline on average, which is critical for valid causal inference.[2][3] In digital settings, randomization is often handled by software platforms that assign users automatically. In clinical settings, centralized randomization systems or sealed envelopes are used.
Data collection proceeds over a predetermined period, after which analysts compare outcomes between the two groups using appropriate statistical tests. For continuous outcomes, independent samples t tests or Mann Whitney U tests are common.[1] For binary outcomes, chi square tests or logistic regression models are used.[1] The analysis should follow the intention to treat principle, meaning all randomized participants are analyzed in the group to which they were assigned, regardless of whether they adhered to the protocol.
It is important to run the test for its full planned duration rather than stopping early when results appear significant, because premature stopping inflates the false positive rate.[3] Sequential testing methods or pre registered interim analyses can be used when early stopping is scientifically justified.
When to use it
A/B testing is appropriate when you want to evaluate the effect of a single, well defined change and can randomly assign participants to conditions. It works best when the outcome is measurable, the sample size is large enough to detect the expected effect, and contamination between groups is unlikely. It is not appropriate when multiple changes need to be tested simultaneously (consider factorial designs instead), when randomization is infeasible (consider quasi experimental designs), or when the outcome takes years to manifest and interim results are urgently needed.[2][3]
Key takeaways
- A/B testing is one of the most accessible and widely trusted methods for establishing causal relationships between an intervention and an outcome.
- Researchers then determine the minimum sample size needed to detect a meaningful difference at a given statistical power, typically 80% or higher, and a chosen alpha level, usually 0.05.
- A/B testing is appropriate when you want to evaluate the effect of a single, well defined change and can randomly assign participants to conditions.
- A frequent error is running the test without an adequate sample size calculation, which leads to underpowered studies that fail to detect real effects or overpowered studies that flag trivially small differences as significant.
Common mistakes
A frequent error is running the test without an adequate sample size calculation, which leads to underpowered studies that fail to detect real effects or overpowered studies that flag trivially small differences as significant. Researchers also commonly "peek" at results before the planned endpoint and stop the test as soon as significance is reached, inflating the Type I error rate well beyond the nominal alpha level.[3]
Another common mistake is testing too many outcome metrics without adjusting for multiple comparisons. If a team measures 20 different outcomes, one is likely to appear significant by chance alone at an alpha of 0.05.[1] Researchers should designate a single primary outcome in advance and treat additional outcomes as exploratory. Finally, ignoring the distinction between statistical significance and practical significance can lead to implementing changes that are statistically detectable but too small to matter in practice.
Example
A health communication team at a regional hospital system randomly assigns 2,000 patients (1,000 per group) to receive either the standard appointment reminder via text message (Group A) or a behaviorally optimized message that includes a specific cost of missing the appointment (Group B). After 30 days, the team finds that the no show rate is 14.2% in Group A and 10.8% in Group B (p = 0.03, two proportion chi square test with continuity correction), representing a 3.4 percentage point reduction. The team calculates that this difference would prevent approximately 680 missed appointments per year if the system sends the message for 20,000 appointments a year.
Test your understanding
5 questions that adapt as you go: answer two in a row correctly and they get harder.
Question 1 of 5
Scenario:
In the hospital reminder study, no-shows fell from 14.2% (A) to 10.8% (B), p = 0.03.
Question:
What does the 3.4 percentage-point figure describe?
Hardness: Interpret
Sources
- [1]Field A. Discovering Statistics Using IBM SPSS Statistics. 6th ed. SAGE Publications, 2024. ISBN 9781529630008
- [2]Creswell JW, Creswell JD. Research Design: Qualitative, Quantitative, and Mixed Methods Approaches. 6th ed. SAGE Publications, 2023. ISBN 9781071817940
- [3]Kohavi R, Tang D, Xu Y. Trustworthy Online Controlled Experiments: A Practical Guide to A/B Testing. Cambridge University Press, 2020. doi:10.1017/9781108653985
Cite this term
A/B Testing. Paperguide Research Glossary. Paperguide, 2026. Available at: https://paperguide.ai/research-glossary/a-b-testing/(Paperguide, 2026)