Code Monkey home page Code Monkey logo

xuehuaze / abtest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chrismaddern/abtest

0.0 2.0 0.0 251 KB

An iOS Library to support A/B Testing remotely defined values in Apps and reporting back to a server. Includes native controls for A/B Testing UIButton text and background image. Includes generic ABTestCase for testing any NSString value.

Home Page: http://www.chrismaddern.com/ab-split-testing-lean-experiments-on-mobile-ios-iphone/

License: MIT License

Objective-C 99.35% Ruby 0.65%

abtest's Introduction

iOS A/B Split Test Library

This is an Objective-C library for performing A-B testing in iOS Apps. Data is configured and results are collected remotely using the companion PHP Server project (https://github.com/chrismaddern/A-B-Split-Test-Server). This project contains a sql export of the state of the database to match the test app in this repository.

Podfile

platform :ios, '5.0'
pod "ABTest", "~> 0.0.5"

Sample Application

There is a basic Sample Application which contains examples of each of the ways to perform an A/B Test.

Ways to perform an A/B Test

Interface builder control

  1. Add a UIButton to the View
  2. Change it's Class to either ABTestButton or ABImageTestButton
  3. Set the User Defined Runtime Attributes:

testCase -> the token of the test case

default -> the control value and used when no test data is available

type -> "url" or "local" (UIImageTestButton only)

The button will report a positive outcome for that test case whenever it is tapped.

Test any string value in code

You can test anything that can be determined with a String using an ABTestCase in your own code.

Code:

// Create a test case
ABTestCase *testCase = [[ABTestCase alloc] initWithTestCase:YOUR_TEST_CASE_ID
                                            andControlValue:THE_DEFAULT_STRING_TO_FALL_BACK_ON];
NSString* testValue = [testCase value];
// Do whatever you want with testValue here 

And then to report the outcome…

// Something good has happened because of this value
ABTestCaseOutcome *outcome = [[ABTestCaseOutcome alloc] initWithTestCase:YOUR_TEST_CASE_ID
                                                      andOutcomeResponse:ABPositiveResponse];
[outcome send];

License

The iOS A/B Split Test Library is licensed under the MIT License.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

abtest's People

Contributors

chrismaddern avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.