Skip to content

Commit

Permalink
BREAKING: Refactor design, drop config atom in favour of explicit con…
Browse files Browse the repository at this point in the history
…fig args
  • Loading branch information
ptaoussanis committed Jul 9, 2013
1 parent 8efcd64 commit 46909a1
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 302 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## v1.0.0 → v2.0.0-RC1
* **BREAKING**: All relevant fns now take an explicit config arg and test-subject id (you can use the `*ts-id*` thread-local binding for this).
* **BREAKING**: Renamed `mab-commit!` -> `commit!`, `pr-mab-results` -> `pr-results`.


## v0.16.0 → v1.0.0
* **BREAKING**: Drop Clojure 1.3 support.
* Some minor bug fixes.
Expand All @@ -7,4 +12,4 @@
## For older versions please see the [commit history][]

[commit history]: https://github.com/ptaoussanis/touchstone/commits/master
[API docs]: http://ptaoussanis.github.io/touchstone
[API docs]: http://ptaoussanis.github.io/touchstone
31 changes: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
**[API docs](http://ptaoussanis.github.io/touchstone/)** | **[CHANGELOG](https://github.com/ptaoussanis/touchstone/blob/master/CHANGELOG.md)** | [contact & contributing](#contact--contributing) | [other Clojure libs](https://www.taoensso.com/clojure-libraries) | [Twitter](https://twitter.com/#!/ptaoussanis) | current [semantic](http://semver.org/) version:

```clojure
[com.taoensso/touchstone "1.0.0"] ; Requires Clojure 1.4+ as of 1.0.0
[com.taoensso/touchstone "2.0.0-RC1"] ; Development (notes below)
[com.taoensso/touchstone "1.0.0"] ; Stable, needs Clojure 1.4+ as of 1.0.0
```

v2 is a **BREAKING** release. It adss explicit test config and test-subject id args to every relevant API fn. See the [CHANGELOG](https://github.com/ptaoussanis/touchstone/blob/master/CHANGELOG.md) for migration details.

# Touchstone, a Clojure A/B testing library

[A/B testing](http://en.wikipedia.org/wiki/A/B_testing) is great for **conversion optimization**. We should all be doing more of it. But traditional A/B tests can be a nuisance to setup and monitor.
Expand All @@ -26,14 +29,10 @@ Touchstone is an attempt to bring **dead-simple, high-power split-testing** to a
Add the necessary dependency to your [Leiningen](http://leiningen.org/) `project.clj` and `require` the library in your ns:

```clojure
[com.taoensso/touchstone "1.0.0"] ; project.clj
(ns my-app (:require [taoensso.touchstone :as touchstone])) ; ns
[com.taoensso/touchstone "2.0.0-RC1"] ; project.clj
(ns my-app (:require [taoensso.touchstone :as touchstone :refer (*ts-id*)])) ; ns
```

### Configuration

Works out-the-box with default Redis configuration. See `touchstone/config` for custom Redis connection requirements.

### Split-testing

Traditional split-testing consists of 4 steps:
Expand All @@ -46,34 +45,26 @@ The particular multi-armed bandit technique used by Touchstone means that we onl

**To optimize a Ring web application**, start by adding `(taoensso.touchstone.ring/wrap-random-subject-id)` to your middleware stack.

One or more named-test selectors can then be used as part of your page content:
One or more test selectors can then be used as part of your page content:

```clojure
(touchstone/mab-select :my-app/landing.buttons.sign-up ; Test name
(touchstone/mab-select {} *ts-id* :my-app/landing.buttons.sign-up ; Test id
:sign-up "Sign-up!" ; Named variation #1
:join "Join!" ; Named variation #2
:join-now "Join now!" ; Named variation #3
)
```

And relevant events recorded:
And relevant events (e.g. conversions) recorded:

```clojure
(touchstone/mab-commit! :my-app/landing.buttons.sign-up 1) ; On sign-up button click
(touchstone/mab-commit! {} *ts-id* :my-app/landing.buttons.sign-up 1) ; On sign-up button click
```

Touchstone will now **automatically** start using accumulated statistical data to optimize the selection of the `:my-app/landing.buttons.signup` test variations for maximum clicks.

And you're done! That's literally all there is to it.

If you're interested, you can examine the accumulated statistical data at any point:

```clojure
(touchstone/pr-mab-results :my-app/landing.buttons.sign-up)
%> MAB test :my-app/landing.buttons.sign-up with 17 total views and a cumulative score of 2:
%> ([:sign-up 28.68] [:join-now 4.33] [:join 1.11])
```

See the `mab-select` and `mab-commit!` docstrings for info on more advanced capabilities like **multivariate testing, test composition (dependent tests), arbitrary scoring, engagement testing**, etc.

## This project supports the CDS and ClojureWerkz goals
Expand All @@ -90,4 +81,4 @@ Otherwise reach me (Peter Taoussanis) at [taoensso.com](https://www.taoensso.com

## License

Copyright © 2012, 2013 Peter Taoussanis. Distributed under the [Eclipse Public License](http://www.eclipse.org/legal/epl-v10.html), the same as Clojure.
Copyright © 2012, 2013 Peter Taoussanis. Distributed under the [Eclipse Public License](http://www.eclipse.org/legal/epl-v10.html), the same as Clojure.
6 changes: 3 additions & 3 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject com.taoensso/touchstone "1.0.0"
(defproject com.taoensso/touchstone "2.0.0-RC1"
:description "Clojure A/B testing library"
:url "https://github.com/ptaoussanis/touchstone"
:license {:name "Eclipse Public License"
Expand All @@ -7,7 +7,7 @@
[org.clojure/tools.macro "0.1.2"]
[org.clojure/math.combinatorics "0.0.3"]
[expectations "1.4.48"]
[com.taoensso/carmine "1.12.0"]]
[com.taoensso/carmine "2.0.0-beta5"]]
:profiles {:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
:1.6 {:dependencies [[org.clojure/clojure "1.6.0-master-SNAPSHOT"]]}
Expand All @@ -31,4 +31,4 @@
"sonatype-snapshots"
{:url "http://oss.sonatype.org/content/repositories/snapshots"
:snapshots true
:releases {:checksum :fail :update :always}}})
:releases {:checksum :fail :update :always}}})
Loading

0 comments on commit 46909a1

Please sign in to comment.