Running an Experiment
Now that we're comfortable with percentage rollouts and how they work under the hood, let's add another layer. Every flag in your LaunchDarkly project has the potential to become an experiment, and setting up an experiment is easy to do. Before we do that, let's talk about what an experiment is and why we might want to use one.
What is an Experiment?
You're already familiar with what experiments are: they're procedures used to validate a hypothesis. In the scientific field, experiments are used to answer questions about the world by collecting quantitative data and performing analysis. But what does it mean to use LaunchDarkly to run an experiment on our users?
We've already learned that we can use LaunchDarkly to serve a random variation to our users, which is a useful function by itself, but we can also use LaunchDarkly to track metrics about our users. When we combine these two functions together, we can start to form hypotheses about changes we can make to the user experience and measure how that impacts user behavior.
Why run an Experiment?
Experiments remove the guesswork required in the software development process. Experiments provide us with answers that are not traditionally easy to answer through product analytics. Analytics alone provides you with the answer to the question "how are my customers using my product," but experiments allow you to answer the questions, "why are they using it that way," and, "how can it be improved." Experiments allow you to validate your work with statistical rigor, and remove doubt from the product development process.
In this lesson, we'll convert our existing runner-speed
feature flag into an experiment and implement a metric that we'll use to validate our hypothesis.