0

How to do code management for AB testing? In particular, how to organize the code (baseline and variant) in the project folder? how to remove code after the experiment?

janetsmith
  • 8,562
  • 11
  • 58
  • 76

1 Answers1

0

There is no "one" answer. You can do this in many ways different folders, different classes or do something as simple as if statement in your code.

I think what you are actually asking is how to find all these experiments in the code. A good solution for this is to make the "experiment definition" code with concrete classes so you can easily find it in your IDE and once you delete the experiment definition class your compilation will break and you will easily find all the places in the code that use it.

A good example of this pattern is used by the open source AB test framework called PETRI, which is promoting exactly that. You create an experiment spec (the AB test definition) as a concrete class and use it to conduct the the test.

    @RequestMapping(value = "/conductExperimentWithSpecDefinition", method = RequestMethod.GET)
@ResponseBody
public String conductExperimentWithSpecDefinition( @RequestParam("fallback") String fallback) throws ClassNotFoundException {
return laboratory.conductExperiment(TestSpecDefinition.class, fallback, new StringConverter());
}