DK Development

The Code behind the man.

abSee 'ay be see' - A/B Test library

I have often wondered “What if” when it comes design aspects of a website.

protected void Application_BeginRequest()
{
    ABTester.Start();
}

From there we can fire off tests to the User where ever we like by calling the Test function. Now to make a test we need to give it a name, this will be used to identify what we are testing in this specific instance. Then you give the function the different options and it will randomly select 1 for you as the output and save the result.

var output = ABTester.Test("MyTest1", "A", "B");

After running the test we then need to let the Tester know if it was successful or not so we can track conversions of the different options. We do this by calling the Convert function with the test name from the test we ran before. abSee will then store that result for us as converted.

ABTester.Convert("MyTest1");

So now we are running tests, how do I see the results?

You can get results for a given test using the GetResults function, this function returns a list of ABSeeResult which contains a few details about the test instance as well as the option that was selected and if it was converted or not.

var results = abSee.ABTester.GetResults("MyTest1");

 

More detailed documentation is coming soon with details on implementing custom storage and user identification.

Feel free to leave me some feedback about abSee or even fork it on Github.

blog comments powered by Disqus