https://github.com/sixpack/sixpack-java
A Java client for the Sixpack A/B testing framework https://github.com/seatgeek/sixpack
https://github.com/sixpack/sixpack-java
Last synced: about 15 hours ago
JSON representation
A Java client for the Sixpack A/B testing framework https://github.com/seatgeek/sixpack
- Host: GitHub
- URL: https://github.com/sixpack/sixpack-java
- Owner: sixpack
- License: bsd-2-clause
- Created: 2015-01-18T16:52:50.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-15T20:47:45.000Z (over 8 years ago)
- Last Synced: 2024-04-07T15:37:56.246Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 242 KB
- Stars: 134
- Watchers: 33
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-java - Sixpack Java
README
# sixpack-java
[](https://travis-ci.org/seatgeek/sixpack-java) [](https://coveralls.io/github/seatgeek/sixpack-java?branch=master)
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:
```groovy
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:
```xml
com.seatgeek
sixpack-java
0.4-SNAPSHOT```
### Overview
The Sixpack client has some nomenclature to be familiar with...
- A _Sixpack server_ is the deployment of the [Sixpack-server](https://github.com/seatgeek/sixpack)
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](#installing)...
The first thing to do is create a `Sixpack` client using the `SixpackBuilder`:
```java
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
0. Create a new experiment from your `Sixpack` instance:
```java
Experiment colorsExperiment = Sixpack.experiment()
.withName("colors")
.withAlternatives(
new Alternative("control"),
new Alternative("red"),
new Alternative("green"),
new Alternative("blue")
)
.build();
```
0. Participate in that new `Experiment` by calling `participate()````java
ParticipatingExperiment participatingExperiment = colorsExperiment.participate();
```
0. When the user performs the action measured in the test, convert the experiment```java
participatingExperiment.convert();
```### Contributing
0. Fork this repo and clone your fork
0. Make your desired changes
0. Add tests for your new feature and ensure all tests are passing
0. Commit and push
0. 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](https://github.com/seatgeek/sixpack-java/issues/new)_
### License
Sixpack-Java is released under the [BSD 2-Clause License](http://opensource.org/licenses/BSD-2-Clause)