A/B testing
A/B testing is a controlled experiment that shows two versions of something, such as a web page, a message or a process step, to randomly assigned groups and compares a chosen outcome. The random split lets the difference in outcome be attributed to the change.
What it is
A/B testing (also called a split test or controlled experiment) compares two versions of one thing by showing each to a different, randomly chosen group of people and measuring the same outcome in both. Version A is usually the existing one, the control. Version B contains the single change under test.
GOV.UK guidance on comparative studies treats an A/B test as a randomised controlled trial for the purposes of design. The Cabinet Office paper on randomised controlled trials explains that a control group shows whether the intervention, rather than outside conditions, produced the effect.
The parts of a test are:
- A hypothesis: the change is expected to move one outcome.
- A primary metric, such as the share of customers who complete an application.
- A random assignment rule that gives every participant the same chance of seeing either version.
- A sample size and a duration fixed before the test starts.
- A statistical comparison of the two groups at the end.
A test with more than two versions is a multi-arm test, built on the same logic with one control.
Why it matters
Before-and-after comparisons mix the effect of a change with everything else that moved in the same period, such as seasonality or a campaign. Running both versions at the same time on randomised groups removes that problem, because outside factors affect both groups alike.
Product, growth and analytics teams use the result to decide whether to adopt a change on evidence rather than preference.
Worked example
Illustrative numbers.
- A bank tests a shorter reminder message against the existing one.
- 5,000 customers are assigned at random to each version.
- Version A (control): 600 of 5,000 respond, a response rate of 12.0%.
- Version B (shorter message): 700 of 5,000 respond, a response rate of 14.0%.
- Observed difference: 2.0 percentage points, or 100 more responses per 5,000 customers.
A statistical test then asks whether a gap of this size is likely to arise from chance alone with groups of this size. If it is unlikely, the difference is attributed to the message. The sample size and the threshold for that judgement are set before the test, not after seeing the data.
Who uses it
- Data analysts and business intelligence analysts build the assignment, compute the metrics and report the comparison.
- Data scientists and statisticians size the test and choose the statistical method.
- Growth and digital marketing analysts test messages, pages and offers against a conversion metric.
- Product owners decide to adopt, change or drop a feature based on the result.
Common confusions
- A split by a fixed rule, such as odd and even customer numbers, is not random assignment and can create groups that differ before the test begins.
- Stopping the test as soon as the gap looks large inflates the chance of a false positive. The duration is fixed in advance.
- A difference that is statistically distinguishable from zero can still be too small to matter for the business.
- Champion-challenger testing compares a model in use with an alternative model on the same data. An A/B test compares the effect of two versions on different groups of people.