Navigation Menu

Skip to content

sixpack/sixpack-java

Repository files navigation

sixpack-java

Build Status Coverage Status

A Java client for SeatGeek's Sixpack a/b testing framework: https://github.com/seatgeek/sixpack

Installing

Sixpack-java is currently only being deployed to maven snapshots, to use it, add the following dependency to your build.gradle:

repositories {
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

dependencies {
    compile 'com.seatgeek:sixpack-java:0.4-SNAPSHOT'
}

or, if you're a maven user:

<dependency>
  <groupId>com.seatgeek</groupId>
  <artifactId>sixpack-java</artifactId>
  <version>0.4-SNAPSHOT</version>
</dependency>

Overview

The Sixpack client has some nomenclature to be familiar with...

  • A Sixpack server is the deployment of the Sixpack-server that will be hosting your test results
  • An experiment represents a single test in the Sixpack server. It can have multiple alternatives
  • An alternative is one potential result returned to the client when participating in an experiment
  • You start a test by participating in an experiment with alternatives
  • Once the server has selected an alternative for you, you can convert the experiment when the user performs the action that you're measuring

Getting Started

After installing...

The first thing to do is create a Sixpack client using the SixpackBuilder:

    Sixpack sixpack = new SixpackBuilder()
            .setSixpackUrl("http://api.mycompany.com/sixpack")
            .setClientId(user != null ? user.sixpackId : getCachedClientId())
            .build();

It is recommended that you maintain a singleton instance of Sixpack with the DI library of your choice.

Creating Experiments

  1. Create a new experiment from your Sixpack instance:

        Experiment colorsExperiment = Sixpack.experiment()
                .withName("colors")
                .withAlternatives(
                    new Alternative("control"),
                    new Alternative("red"),
                    new Alternative("green"),
                    new Alternative("blue")
                )
                .build();
  2. Participate in that new Experiment by calling participate()

        ParticipatingExperiment participatingExperiment = colorsExperiment.participate();
  3. When the user performs the action measured in the test, convert the experiment

        participatingExperiment.convert();

Contributing

  1. Fork this repo and clone your fork
  2. Make your desired changes
  3. Add tests for your new feature and ensure all tests are passing
  4. Commit and push
  5. Submit a Pull Request through Github's interface and a project maintainer will decide your changes fate.

note: issues can be submitted via github issues

License

Sixpack-Java is released under the BSD 2-Clause License

Releases

No releases published

Packages

No packages published