Published: By: Per Spetz Reading time: 10 min

How many users you need to start A/B testing

Image by Fraser Morrison under CC BY-NC-ND 2.0

“You need at least x users to be able to A/B test in your product!”
I see this kind of claim every now and then, often as a reason why validating tests aren’t relevant for this particular product. Is there a magic threshold when you can start A/B testing your hypotheses?

My highly personal empirical evidence says it either comes from product people who don’t want to embrace data-driven development methods, or from data people who think statistical method is the most important part of discovery work. A bit pointed perhaps, and both camps have their points.

With small user volumes there can be relevant reasons not to use A/B tests. Maybe the product has just been launched to a small group of invited beta users, or it’s a B2B solution where the total market amounts to a hundred or so customers. Then A/B tests are probably not the primary tool in the discovery toolbox. (Our friends at the excellent podcast Datadrivet released an episode on 21 March on the theme of validation for products between pre-launch and growth, so tune in at the link if you want to learn more about exactly that!)

And I agree that statistical method is the cornerstone of A/B testing, and user volumes play a decisive role in experiment design. Even so, I think claims that there are certain conditions or thresholds for even being able to A/B test reveal a rather backwards approach to experimentation and validation. So what’s the deal?

In this article I explain why I think the question is wrongly framed, and how you should instead think about A/B testing and validated learning for a product that still has relatively small user volumes.

Part 1: Probability and statistics 101 in 3 minutes

Why do we complicate things?

At the end of the day, an A/B test is a hypothesis test decided by a significance test. But why do we need to bring probability into it? Why not just release our new gadget and see how it affects user behaviour and our metrics? (Say it together:) Because there can be loads of other things affecting user behaviour. It’s simply very hard to say whether a kink in the curve is due to our cool new gadget or whether it was something completely different affecting that particular period.

But if we can release the new gadget in parallel with the original and compare the results between the groups, then we’ll see which one does best, right? That’s on the right track, but we still can’t rule out that chance plays a part. Maybe all our big customers ended up in one group, or a few more people in the other group happened to go on holiday and so had much more time to spend in our product. In fact, if we were to split a user base into two randomised groups and give them exactly the same experience (a so-called A/A test), our metrics would differ when we compare the groups. User behaviour varies randomly over time, both at an individual and an aggregated level, so we can never remove chance completely, but with the help of a statistical model we can calculate the probability that our result is not due to chance.

Significance and power

So we have a hypothesis saying that B is better than A according to a certain metric, and it’s time to construct an experiment. In short, we do the following:

  • We choose a statistical model that describes what we want to measure, e.g. a binomial test for a click conversion, something that often happens “under the hood” in an experimentation platform.
  • We create two groups through random sampling from our user base, often with the help of some form of assignment engine in the experimentation platform.
  • We give each group treatment A and treatment B via some form of feature flagging or equivalent.
  • We calculate the probability that any difference between the groups is not due to chance, i.e. is statistically significant.

If the result of the experiment is significant, then in statistical terms we should reject the so-called null hypothesis and accept our hypothesis as true, i.e. B is better than A. But this only applies under the conditions of our statistical model, and as mentioned earlier, the model must allow for a controlled margin of error and chance, so we can’t be completely sure.

Type 1 and type 2 errors

Even a flawlessly executed experiment has two possible pitfalls, usually called type 1 errors and type 2 errors:

  • Type 1 errors (false positives): The null hypothesis is true, i.e. there is no real difference between A and B, BUT our results show a significant difference between the groups (due to random variation), and that we should therefore reject the null hypothesis.
  • Type 2 errors (false negatives): The null hypothesis is not true, i.e. there is a real difference between the groups, but our results are not clear enough for us to reject the null hypothesis.

So these errors don’t mean something has gone wrong. There has to be room for some controlled uncertainty for experiments on randomly sampled groups to work.

Somewhat simplified, we adjust for type 1 errors by raising or lowering the significance level in our statistical model. The classic is 95%, i.e. we consider our results significant if, according to our model, there is a < 5% probability that our results are due to random variation. Put a bit bluntly, the standard is that about 1 in 20 experiments wrongly rejects the null hypothesis, thereby making a type 1 error and drawing the wrong conclusion. If that feels too risky, we can, for example, raise the significance level to 99% and thereby reduce the risk of type 1 errors from 5% to 1%, but at the same time the risk of type 2 errors increases, unless we also increase the test's power. Power is the experiment's ability to actually detect real differences within the random variation, in other words to avoid type 2 errors, and maximising the power of the experiment is the main part of experiment design.

Part 2: Experiment design in practice

The toolbox

When we design our experiment, we need to strike a balance between type 1 and type 2 errors, or significance level and power. So as not to lose everyone who doesn’t happen to have a master’s degree in statistics, my experience is that the significance level should be kept constant regardless of the test, often at exactly 95%. (And sure, not being flexible with the significance level too is sub-optimisation, but the communication challenge of explaining different significance levels and how they should weigh into the decision usually outweighs the benefits.)

So which parameters can we tweak?

1. Sample size:

The number of participants/trials included in the experiment. The heaviest tool in the toolbox (and the reason for the title of this article): a bigger sample = more power. To optimise sample size, the most common approach is to let the experiment run over a longer period, since active users usually increase over time. Increasing the time is costly, however, both as an opportunity cost in slowing down the speed of learning, but it can also be associated with direct costs, e.g. if the experiment involves discounts or similar, and bigger samples tend to generate more questions to customer support.

The longer the test is out in the wild, the greater the chance that other releases happen that potentially interact with what you’re investigating and turn the analysis upside down. You get the idea. Other options are to run the test where most users are (e.g. a start view), or to include more markets/platforms/operating systems, but this also often means more development time and cost. Nor is it always possible to abstract the hypothesis across different contexts, or guaranteed that the user experience isn’t negatively affected by “artificially” increasing the sample size in this way, so you should definitely not maximise sample size just because you can. Modern experimentation platforms often offer sample size calculators as part of the platform, which can help you with the power analysis.

2. Minimum detectable effect/MDE:

The size of the expected effect of our treatment, often abbreviated MDE. Do we think our new variant will increase the conversion rate by 5% or 20%? A copy change or rearranging elements in the UI are classic ideas for A/B tests, but in my experience they rarely produce any huge changes in user behaviour and metrics. Small MDEs can be perfectly reasonable if you’re Amazon.com, where you have enough power thanks to enormous samples and where an MDE of 1% in purchase conversion means an insane amount of money, whereas in other non-hyper-optimised cases there are often more interesting things to test. Tackling users’ actual problems with more significant changes not only has a higher potential to improve the user experience, but also a greater chance of giving a large MDE, and therefore measurable effects (which is also why user research and qualitative data are indispensable for successful A/B testing, even from a purely statistical perspective).

I often try to turn the change up as much as possible, especially the first time I test a new hypothesis, precisely to maximise the MDE: if you want to see whether volume discounts have the potential to drive additional sales for your product, try offering a 30% discount to a smaller sample, even if you know 15% would be more realistic given your current margins. Decouple the hypothesis from the feature (if you can afford it), and use radical design to maximise power and the speed of validated learning.

3. The size of our test metric:

A larger test metric (for example a conversion rate) makes it easier to detect relative differences between our variants, which ties in with our MDE. If we have an expected MDE of 10% for two different test metrics, then of course 10% of 50% is larger than 10% of 20%. The larger the absolute change, the greater the probability that our experiment design has enough power to detect it.

A constant dilemma is the choice of using downstream metrics like purchase conversion as the test metric, which are often much lower compared with upstream metrics like adding to basket and so on. The transaction is often the goal, but will we have enough power if it’s just a percent or so? The most common tricks for increasing power through the size of our test metric are to go upstream in the funnel, which always means higher conversion rates, and sometimes also automatically a bigger sample size depending on where we’ve placed our treatment, or to look at different types of proxy metrics.

These are far from all the tricks available when it comes to practical experiment design and optimising statistical power, and every parameter would deserve an exhaustive text of its own. Neither the feasibility nor the power of A/B tests is decided by sample size alone, and even products with large user volumes should do their homework to keep their experiments as cheap and fast as possible.

An illustrative example

If we compare two different companies:

  • Company 1:
    E-commerce selling posters
    Traffic: 200,000 users per week
    Purchase conversion rate: 1.5%
  • Company 2:
    E-commerce selling hand-painted canvases with guinea pig motifs.
    Traffic: 1,000 users per week
    Purchase conversion rate: 1.5%

Internal search is the most common way to find posters/paintings, and both companies want to add a new search algorithm that takes into account what has sold best in the last week. Based on user research and existing data, they believe the effect on conversion would be about 10%, i.e. from about 1.5% to 1.65%. We do our power analysis and get the following:

Power analysis for Company 1 and 2

We see that Company 1 will have no problem testing its hypothesis with the proposed experiment design. The p-value given the assumptions is 0.0019, i.e. far below the threshold of 0.05. In other words, it would be extremely unlikely for our experiment to have too little power to pick a winner. For Company 2 things look tougher: a p-value of 0.4 means there’s a 40% probability that it’s just random variation that generated the potential difference between the variants. With that much uncertainty, we might almost as well flip a coin. So Company 2 can forget about A/B tests, then?

No! We go through our 3 parameters and think about how we can tweak the experiment design.

Sample size: If we run the test for 4 weeks instead, we can quadruple our sample size (at least in this idealised example)

Size of the test metric: We check our funnel data and see that on average there’s a 10% conversion to adding a guinea pig painting to the basket. So much higher than the purchase conversion of 1.5%

MDE: From previous experience we know that we usually see bigger effects upstream in the funnel, where there isn’t as much commitment from the customer, and we think we can expect an MDE of 20% for “add to cart”.

We calculate a new p-value given our new experiment design:

Updated power analysis for Company 2

So here we have two identical hypotheses in very similar contexts, but the user volumes are vastly different. Company 1 is 200 times bigger than Company 2, measured in weekly active users. Yet both experiments above would have enough power, given our assumptions.

If our hypothesis is that the search results are more relevant with our new algorithm, my personal judgement would be that scenario 2 is more than good enough to validate that the new algorithm does its job: more users seem to find relevant products they’re interested in! It’s not as decisive an insight as a significant increase in purchases and revenue would have been, but it’s infinitely better than not validating the new search algorithm at all, which is often the alternative.

Ask not what A/B tests can do for you…

The question behind this text is almost always phrased as “How many users do I need to A/B test?” when the relevant question is “How can I A/B test with the users I have?”, and as I hope I have managed to communicate in this text, smart experiment design can validate both small optimisation ideas and bigger bets, even at lower user volumes.

In my opinion, this is exactly what makes up the core competence of a skilled growth and experimentation team. Even though I consider nimble A/B testing something of a gold standard for validated learning, it’s not a universal solution for everything. I’m a big fan of so-called smoke screen / painted door tests for trialling new ideas, or good old surveys for that matter. A first step that rarely fails is to start asking colleagues, passers-by or, at best, real users what they think. It’s not validation that would hold up for clinical trials, but already here you can start to sense whether what you believed actually seems likely or not.

Those who are smartest in their experiment design, given the practical conditions of the product, are also those who generate the most validated learning the fastest.

So, is there a lower threshold for sample size? As you may have figured out by now, my answer is no. In practice, though, I stick to this rule of thumb: could you and your team, in theory, pick up the phone and call every single user of the product within a week/sprint and ask them what they think? If the answer is yes, that’s probably preferable. Otherwise, I think you should go for it!

I hope this text has inspired you to get started testing new builds and validating your hypotheses, even if your product doesn’t have thousands of users today. We can never be completely sure in our validation, despite A/B tests (type 1 errors are a thing!), and all validation methods move along a sliding scale of controlled uncertainty.

If you have input, questions or just want to talk more about A/B testing, add me on LinkedIn or send an email!