SimpleAB - A simple framework for A/B tests
SimpleAB is a framework to help you A/B test your Android applications with no hassle. A/B testing should be as simple as it needs to, and if you're not interested in handling huge SDKs and understanding complex dashboards and documentation articles, SimpleAB is the tool you was looking for.
SimpleAB will make A/B tests as easy to run as to write a one-liner like:
Note that you can define as many variants as you want, as long as you define different IDs for them. The IDs, by themselves can be any
String you want, as long as they are not
Drawer is responsible for selecting which
ABTestVariant will be executed. The library has a default
Drawer built-in, that leverages the usual java
Random implementation for pseudo-randomic choosing.
If you want, you can also define your own class that
implements ABTestDrawer. You can then define any strategy to select test variants, for example by defining weights for each variant (this example is implemented in the
sample project of the library), or by taking in account the IDs of the variants.
Listener for callback
It's also optional to define an
ABTestListener so you can have a callback after a variant is drawn. To do that, simply define a class that implements the interface and override its methods. The callback method will be executed after the A/B test runs. This way, you can perform any subsequent task to the test, like
POST-ing the result to a server, for example.
The API will then be something like:
Persistence of chosen variants
By default, the library persists the chosen variants in
SharedPreferences. This way, once your app runs for the first time and the variants are chosen by the
Drawer, the app state regarding your A/B tests will stay the same for the subsequent runs (unless the user
clears app data).
If you are debugging your application and want to avoid the need to clear the app data to re-draw your A/B tests variants, you can simply call
before performing your A/B tests. This will bypass the persisting step of the library, and by that, the system will always
draw() variants based on your