CLI tool
splitrb/split avatar
splitrb/split

Split, the Rack A/B testing gem: Redis 4.0 minimum, a z test that needs 30 participants, and overrides pinned from a URL

:chart_with_upwards_trend: The Rack Based A/B testing framework

2,708 stars369 forksRubyMIT

At a glance

What is it?
Split hands out variants through ab_test and keeps them in Redis. The dashboard defaults to a statistic that stays silent below 30 participants, and the override switch is a plain query parameter.
Who is it for?
Split fits a Rails or Sinatra application that already runs Redis 4.0 or later and can accept a dashboard statistic that says nothing until a branch has 30 participants and 5 conversions. Three things to check before adopting it.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 15 days ago.
What is it written in?
Mainly Ruby, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • splitrb/split2,708 ★ · +0
Star history
Repository2026-10-042026-11-15
splitrb/split2.7k2.7k

0 Stars in the last 42 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

Ruby 2.5 and Rails 5.2 are the v4 floor, with two older lines parked behind it

Only the v4 line is in current use. The stated test matrix is Ruby >= 2.5 and Rails >= 5.2, and anything older is pushed onto a different release: Ruby 2.4.x or older Rails applications are sent to v3.0, and Ruby 1.9.3 applications to v0.8.0. That mapping is the whole upgrade story, and it reads as a fallback rather than a schedule, because no end-of-life date is given for v3.0.

The release dates leave a gap of their own. The three newest published versions are v4.0.2 from 2022-12-02, v4.0.3 from 2023-11-15 and v4.0.5 from 2025-08-04, with no v4.0.4 among them. The main branch was pushed on 2026-09-15, more than a year after the newest gem, so anything committed since then is reachable from a clone but not from `gem install split`.

The project is MIT licensed, carries no topics, and points its homepage field at rubygems.org/gems/split rather than at the GitHub tree. The counters read 2707 stars, 369 forks and 35 open issues.

Redis is the datastore, and the install recipe only covers one machine

Redis is not an optional extra here, it is where the state lives, and only Redis 4.0 or greater is supported. The whole install recipe offered is two commands written for macOS with Homebrew:

bash
brew install redis
redis-server /usr/local/etc/redis.conf

What that leaves is a daemon on port 6379. The path in the second command is hardcoded to `/usr/local/etc/redis.conf`, an Intel Homebrew prefix, so the same two lines do not transfer to a Linux machine or to a different prefix.

Nothing beyond that is specified about the connection. The Rails section says that adding `gem 'split'` to the Gemfile autoloads at startup and that, once Redis is configured, it will 'just work'. Which client library to use, which URL form, whether a password is required, and how to point a test run at a separate Redis database are all left to the application. The gem itself installs with:

bash
gem install split

The repository tree lists no configuration file for the gem beyond the Gemfile, the gemspec and the Rakefile.

Rails autoloads the gem; Sinatra needs sessions, a helper and a stub route

Rails is the short path: add `gem 'split'` to the Gemfile and it loads when Rails boots. Sinatra needs three things spelled out, the require, session support and the helper mixed into the app:

ruby
require 'split'

class MySinatraApp < Sinatra::Base
  enable :sessions
  helpers Split::Helper

  get '/' do
  ...
end

The sample route is a stub. The body of `get '/'` is three dots, so the example stops before any call. Sessions are the reason a Sinatra application needs `enable :sessions` in the first place, since the alternative a visitor draws has to survive to the next request.

Two methods do the work. `ab_test` takes the experiment name first and the alternatives after it, returns one of them, and hands a returning visitor the same one as before:

erb
<% ab_test(:login_button, "/images/button1.jpg", "/images/button2.jpg") do |button_file| %>
  <%= image_tag(button_file, alt: "Login!") %>
<% end %>

`ab_finished` marks the conversion, from a controller or inline in a view:

erb
Thanks for signing up, dude! <% ab_finished(:signup_page_redesign) %>

That inline example names `signup_page_redesign`, and no `ab_test` call anywhere in the file declares an experiment of that name.

The dashboard default stops answering below 30 participants and 5 conversions

Two statistics are on offer, and the one enabled by default has hard floors. The default is a z test over the difference between control and alternative conversion rates, applied when n > 30. It reports whether an alternative is better or worse than control, at 90, 95 or 99 percent significance, and it will not pick the best alternative when an experiment has more than one. It also needs more than 30 participants and 5 conversions for each branch before it reports anything.

That default sits awkwardly against the library's own example, which tests three alternatives in a single call:

ruby
def register_new_user
  # See what level of free points maximizes users' decision to buy replacement points.
  @starter_points = ab_test(:new_user_free_points, '100', '200', '300')
end

A three way test of point values is precisely the case the default statistic refuses to rank, so reading this example through the default dashboard yields better or worse against control and never a winner. The conversion that would complete it is a separate call:

ruby
def buy_new_points
  # some business logic
  ab_finished(:new_user_free_points)
end

The sizing advice that comes with both statistics is to fix the required sample size per branch before starting, because running without it raises the rate of false positives, and a sample size calculator is linked for the purpose.

Winner probabilities come from simulations recomputed while the dashboard renders

The second statistic simulates from a beta distribution and reports the probability that a given alternative beats all the others. You reach it through a drop-down labeled Confidence, and the guidance is to use it whenever an experiment has more than one control and more than one alternative. It also works for a plain two way test. The probabilities are cached, and the cache interval is configurable:

ruby
Split.configure do |config|
  config.winning_alternative_recalculation_interval = 3600 # 1 hour
end

The stated default is once per day. The catch is where that recalculation runs, because it is triggered while the dashboard renders, so a group of experiments that all come due at once makes page loads slow. The escape hatch is to switch the dashboard calculation off and drive the work from a background job:

ruby
Split.configure do |config|
  config.dashboard_calculate_winning_alternatives = false
end

The job given for that purpose is `Split::ExperimentCatalog.all.each(&:calc_winning_alternatives)`. With the switch off, the dashboard keeps showing the most recently calculated probabilities, and no age or timestamp is attached to them, so a stale table is indistinguishable from a fresh one.

A ten percent rollout is written three ways in the same example

Weighted alternatives are the first thing most teams reach for, and all three forms offered express the same ten to one split:

ruby
ab_test(:homepage_design, {'Old' => 18}, {'New' => 2})

ab_test(:homepage_design, 'Old', {'New' => 1.0/9})

ab_test(:homepage_design, {'Old' => 9}, 'New')

A hash pairs an alternative name with its weight, a bare string takes the default weight of 1, and the second and third lines show the two shapes mixed in one call. The stated outcome is that the new alternative reaches one visitor in ten.

Two questions are left open. No rule is given about whether the weights must add up to a particular total, or how a fractional weight behaves next to an integer one in the same argument list. There is also arithmetic worth doing before launch: an alternative that only reaches one visitor in ten needs ten times the traffic per branch to gather the 5 conversions the default z test asks for, so a weighted rollout has to be sized for the exposure rate rather than for the total audience.

Overrides are a query parameter, and they never reach the results

Both override paths are meant for development and testing, and both are visible to anyone who knows the parameter names. The URL form is `http://myawesomesite.com?ab_test[button_color]=red`, which forces the red alternative of the `button_color` experiment for that request. It is not written to the session and does not count toward results unless the `store_override` option is turned on. The dashboard's Force for current user button does the same thing through a `split_override` cookie, which is exactly why an experiment you have pinned can keep reading zero participants. The page lists any overrides active in your browser at the top and clears them individually or all at once.

The wider switch is `SPLIT_DISABLE`, a query parameter that disables all tests at once without naming any individual experiment.

What the documentation does not add is any restriction on the URL form. There is no allowlist for who may pin an alternative, no environment distinction, and no warning that an unreleased variant can be reached by anyone who guesses the experiment and alternative names. A staging variant protected by nothing but its name is reachable on any host that accepts the parameter.

The disable switch has a parameter name but its example URL stops mid line

The last thing in the file is unfinished. The `SPLIT_DISABLE` paragraph is followed by an indented example URL reading `http://myaw`, and the document stops there, so a reader gets the parameter name and a URL no browser would resolve.

That break also bounds the configuration surface. Four names appear across the document: `winning_alternative_recalculation_interval`, `dashboard_calculate_winning_alternatives`, `store_override` and the `split_override` cookie. Two of them are shown inside `Split.configure` blocks with the code written out, and `store_override` receives a single sentence. No complete default configuration is printed, no environment variables are named, and no Redis key layout or migration step is described.

For a framework whose entire state lives in Redis, that leaves the storage side to whoever adopts it.

Editorial conclusion

Split fits a Rails or Sinatra application that already runs Redis 4.0 or later and can accept a dashboard statistic that says nothing until a branch has 30 participants and 5 conversions. Three things to check before adopting it. Which gem version your Ruby and Rails versions map to, since only v4.0+ is tested on modern stacks and the documented fallbacks stop at v3.0. Whether main has moved past v4.0.5, the newest published release, because a clone and an installed gem are then not the same code. And what you intend to do about overrides that travel in the query string and never reach the results.

Frequently asked questions

What does Split need before it can run an A/B test?

A Redis 4.0 or greater datastore, plus Ruby >= 2.5 and Rails >= 5.2 for the v4 line. On macOS the two documented commands are brew install redis and redis-server /usr/local/etc/redis.conf, which leave a daemon on port 6379.

How does Split decide which variant of an experiment won?

Two ways. The dashboard default is a z test over 30 participants that reports 90, 95 or 99 percent significance for an alternative against control, and it needs more than 30 participants and 5 conversions per branch. The Confidence drop-down switches to beta distribution simulations that rank an alternative against all the others.

Can I show a new variant to only ten percent of visitors in Split?

Yes, by passing a weight with the alternative. ab_test(:homepage_design, {'Old' => 18}, {'New' => 2}), ab_test(:homepage_design, 'Old', {'New' => 1.0/9}) and ab_test(:homepage_design, {'Old' => 9}, 'New') are the three forms, and the default weight for an alternative is 1.

What does the SPLIT_DISABLE parameter do in Split?

It is a query parameter that switches off every test at once, without naming individual experiments. Overrides pinned through ab_test[button_color]=red or the dashboard's Force for current user button are not counted unless store_override is set, so a pinned experiment can keep reporting zero participants.

How does Split record that a visitor converted?

The ab_finished method marks the completion of an experiment, and it can be called from a controller or written inline in a view. The controller example pairs ab_finished(:new_user_free_points) with the ab_test call that assigned the alternative, while the inline view example fires ab_finished(:signup_page_redesign) straight after the sign-up text.

Which Split release should an app on an older Rails install?

Only v4.0+ is tested with Ruby >= 2.5 and Rails >= 5.2. Applications on Ruby 2.4.x or older Rails are pointed at v3.0, and Ruby 1.9.3 applications at v0.8.0. The newest published release is v4.0.5 from 2025-08-04, while the main branch was last pushed on 2026-09-15.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. splitrb/split on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/splitrb-split.svg)](https://hysenlabs.com/projects/splitrb-split)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/splitrb-split.svg)](https://hysenlabs.com/projects/splitrb-split)

Was this useful?