x Take the InfoQ Survey !

Facebook Open-Sources PlanOut, a Framework for Online Field Experiments

by Sergio De Simone on Apr 25, 2014 |

PlanOut is Facebook's language for online field experiments supporting "A/B tests," factorial designs, as well as more complex experiments. According to Facebook, PlanOut makes possible to separate experimental design from application code and allows experimenters to concisely describe their designs.

PlanOut is implemented through an open source Python-based framework available on GitHub. Its main ability is providing randomized values for parameters that control an online service so that experimenters do not need to use constants to manage UI or feature alternatives and just let PlanOut determine the values of those parameters.

The PlanOut framework includes:

  • Extensible Python classes for defining experiments that make it easy to implement randomized assignments, and automatically log important data.
  • A system for managing multiple mutually exclusive experiments, including follow-on experiments.
  • A reference implementation of the PlanOut interpreter, which lets you serialize, store, and execute experiment definitions.
  • A compiler that transforms the PlanOut domain specific language into serialized PlanOut code.

An example of experiment provided on PlanOut's GitHub page is:

class MyExperiment(SimpleExperiment):
  def assign(self, params, userid):
    params.button_color = UniformChoice(choices=['#ff0000', '#00ff00'],
    params.button_text = UniformChoice(choices=['I voted', 'I am a voter'],

The objective of a PlanOut experiment is describing how units, e.g. users, should get mapped to service parameters. In the example given above, a button's color and text are uniformly randomized across users.

Once an experiment is defined, it can be queried from the application code to find out what values should be used for the current user:

my_exp = MyExperiment(userid=42)
color = my_exp.get('button_color')
text = my_exp.get('button_text')

The framework ensures that values are correctly randomized and that each unit (in the example, the userid) will always map onto the same parameter values.

An additional advantage of using PlanOut is that as soon as an experiment parameters are accessed, the relevant data required to analyze the experiment are automatically logged.

PlanOut also addresses the need of running multiple experiments on the same parameters through parameter namespaces. Namespaces allow running experiments both sequentially, as in iterative testing, or in parallel, as when different teams are experimenting with the same aspects of the service.

Facebook claims to be using PlanOut to run over a thousand experiments each day that involve hundreds of millions of people, although they are using a different implementation of the language written in Hack.

Online field experiments are an approach to testing design alternatives, better attribute outcomes to causes, and estimate effects that help decision makers understand how people react to changes and use their services.

You can also check InfoQ "A/B testing" section for more great content about online field experiments.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Java? by Aravind Yarram

Is there a Java equivalent available?

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss
General Feedback
Marketing and all content copyright © 2006-2015 C4Media Inc. hosted at Contegix, the best ISP we've ever worked with.
Privacy policy