A/B tests
6 minAfter this lesson you can plan a test for an AI feature: what you expect, what you'll measure, how many people you need and when you'll stop, all written before the first result.
Lesson video
Tastebud · 5:31 · Captions on screen
Write the hypothesis, the metric, the sample size and the stop rule before the test starts.
- Why. Early results swing the most, because few people have seen each version. Decide the rules first, or you'll stop the moment a number says what you hoped.
- Real example. In 2022, 95 developers were split at random, 45 with Copilot and 50 without, to build one HTTP server. Copilot users finished 55.8% faster. (GitHub Copilot, Nov 2026)
- When to break it. When harm is plain, stop without a test. In January 2025 Apple paused AI notification summaries for all news apps after one misreported a BBC story.
- Common mistake. Reporting a number without its range. Copilot users' finish rate was 7 points higher, but the range ran from 11 lower to 25 higher, so it settled nothing.
Our take. Teams validate AI features by asking if people like them. In GitHub's Copilot trial, developers guessed 35% faster; the clock said 55.8%. Measure behaviour, fix the sample size first, and treat a range crossing zero as no answer.
Small tests give wide ranges
A test gives you a range, and the headline number is its middle. With 95 developers, Copilot's measured gain was 55.8%, but the real gain could sit anywhere from 21% to 89%. More people narrow the range.
95 developers: 55.8% faster, somewhere between 21% and 89%
- Low end: 21%. The smallest gain the trial supports, at the usual 95% confidence.
- What developers guessed: 35%. Asked afterwards, developers in both groups guessed about 35% on average, well under what the clock measured.
- Measured: 55.8%. Among those who finished, average time fell from about 161 minutes to about 71.
- High end: 89%. The largest gain the trial supports. A bigger sample would pull both ends closer.
A range that crosses zero settles nothing
The same trial also checked whether more developers finished the task. That range crossed zero, so the trial can't say either way, and an honest report says so.
- 'Copilot helps 7 points more developers finish': reads the middle as fact
- 'Copilot makes fewer developers finish': the low end is only one edge
- Faster: 21% to 89%, all above zero, so settled
- Finishing: 7 points higher, range 11 lower to 25 higher
- That range crosses zero, so not settled with 95 people
- Size the next test for the question left open
GitHub Copilot trial with 95 developers, run May to June 2022 and published Feb 2023.
Stop when the plan says, not when B looks good
Peeking means checking results early and stopping the moment they look good. Early numbers swing the most, so stopping on a good day often ships luck.
On day two, the size you wrote down decides when to stop, not B's lead
- Day two: B leads by 4. An example test: 300 people have seen each version, and the plan said 8,000 each. Your product manager wants to ship today.
- Read the range, not the lead. With 300 in each, the range is about 5 points either side, so a 4-point lead can vanish.
- Point to the written plan. The size you set before the test is the only stop that hope didn't choose. Stopping on a good day often ships luck.
- Keep running to 8,000 each. Early numbers swing the most, and they settle as more people arrive.
- Decide at the planned size. Ship, change or drop B once each version reaches 8,000.
Try it
Watch a simulated A/B test settle
A simulation with made-up numbers. Version A turns 10 in every 100 visitors into buyers, and version B really does a little better. Drag the number of people in each version and watch how sure you can be.
Quick check
You're testing AI-written replies against hand-written ones. After two days the AI version leads by 3 points with 200 people in each, and the plan said 5,000. What do you do?
Watch next
Watch it for How people are split at random so the change is the only difference between the two groups.
Watch it for How the smallest gain worth finding decides how many people each version needs, before the test starts.
Connects to: 6.4 KPI trees · 8.1 Writing a hypothesis · 16.5 Testing with users · 17.2 Writing a case study
Sources · checked Nov 2026
- Peng, Kalliamvakou, Cihon and Demirer: The Impact of AI on Developer Productivity, Evidence from GitHub Copilot (arXiv, 13 Feb 2023)Trial ran 15 May to 20 June 2022; 95 professional developers recruited on Upwork, most from India and Pakistan, randomly split 45 with Copilot and 50 without; task: write an HTTP server in JavaScript, timed until all 12 tests passed; 55.8% faster (71.17 vs 160.89 minutes), 95% confidence interval 21% to 89%; success rate 7 points higher, interval -11 to +25 points, not significant; both groups estimated about 35% gain
- TechCrunch: Apple pauses AI notification summaries for news after generating false alerts (16 Jan 2025)Apple disabled notification summaries for all news and entertainment apps with iOS 18.3 betas after the BBC complained that a summary misrepresented one of its articles
- Harvard Business Review: Kohavi and Thomke, The Surprising Power of Online Experiments (Sep-Oct 2017)A Bing employee's idea to change how ad headlines display was rated low priority and waited more than six months; an engineer's A/B test showed results within hours, tripping a too-good-to-be-true alert; revenue rose 12%, worth more than $100 million a year in the US