A/B Testing Framework
Design, run, and analyze conversion experiments with statistical rigor.
Install
git clone https://github.com/thatrebeccarae/claude-marketing.git && cp -r claude-marketing/skills/ab-testing-framework ~/.claude/skills/
Test Design Process
Step 1: Hypothesis
Template: If we [change X], then [metric Y] will [increase/decrease] by [Z%] because [reason].
Good hypothesis: "If we change the CTA from Get Started to Start Free Trial, then signup rate will increase by 15% because it reduces uncertainty about cost."
Bad hypothesis: "If we change the button color, conversions will improve." (No reasoning, no expected magnitude.)
Step 2: Sample Size Calculation
To determine how long to run a test:
Required sample per variation = 16 * (p * (1-p)) / (MDE^2)
Where:
p = baseline conversion rate (as decimal)
MDE = minimum detectable effect (as decimal)
| Baseline Rate |
10% MDE |
20% MDE |
30% MDE |
| 1% |
253,414 |
63,354 |
28,157 |
| 3% |
82,369 |
20,592 |
9,152 |
| 5% |
48,640 |
12,160 |
5,404 |
| 10% |
23,040 |
5,760 |
2,560 |
| 20% |
10,240 |
2,560 |
1,138 |
Minimum test duration: 2 full business weeks (to capture day-of-week effects), even if sample size is reached sooner.
Step 3: Test Execution Rules
- Random assignment — visitors must be randomly assigned to control/variant
- No peeking — do not check results before reaching sample size
- No mid-test changes — do not modify variants during the test
- Even traffic split — 50/50 for A/B, even splits for multivariate
- Single variable — change only one thing per test (unless multivariate)
- Full duration — run for the pre-calculated duration, not until significance
Step 4: Statistical Analysis
Frequentist Approach
Z-test for proportions:
Z = (p1 - p2) / sqrt(p_pooled * (1 - p_pooled) * (1/n1 + 1/n2))
Where:
p1, p2 = conversion rates of control and variant
p_pooled = (x1 + x2) / (n1 + n2)
n1, n2 = sample sizes
p-value interpretation:
- p < 0.05: Statistically significant (95% confidence)
- p < 0.01: Highly significant (99% confidence)
- p >= 0.05: Not significant — do not declare a winner
Bayesian Approach
When to use Bayesian:
- Low traffic (small sample sizes)
- Need to make decisions faster
- Want probability of each variant being best (not just "significant or not")
Interpretation: "There is a 94% probability that Variant B is better than Control" vs frequentist "We reject the null hypothesis at 95% confidence."
Step 5: Decision Framework
| Result |
Significance |
Action |
| Variant wins |
p < 0.05 |
Implement variant |
| Control wins |
p < 0.05 |
Keep control, learn from failure |
| No difference |
p >= 0.05 |
Keep control, test something bigger |
| Variant wins |
p = 0.05-0.10 |
Consider traffic — may need more time |
Common Testing Pitfalls
- Peeking — checking results early inflates false positive rate from 5% to 26%+
- Stopping early — reaching significance != reaching required sample size
- Testing too many variants — each variant needs full sample size
- Ignoring segments — overall winner may be loser for key segments
- Too small an effect — testing for 2% lift needs enormous sample sizes
- Not accounting for seasonality — run full weeks, avoid holidays
- Multiple metrics — primary metric must be pre-declared; secondary are directional
- Survivorship bias — only measuring users who complete, not those who abandon
- Simpson paradox — segment-level winners can reverse at aggregate level
- Novelty effect — new designs get temporary lift; re-test after 2-4 weeks
What to Test (Prioritized by Impact)
High Impact
- Value proposition / headline
- CTA text and placement
- Pricing and offer structure
- Form length (fields removed)
- Page layout (single column vs multi)
- Social proof presence and placement
Medium Impact
- Image/video vs static
- Testimonial format (text vs video)
- Navigation presence on landing pages
- Trust badges and security signals
- Urgency elements (countdown, stock)
Low Impact (Usually Not Worth Testing)
- Button color (unless extreme contrast issue)
- Font changes
- Minor copy tweaks
- Icon styles
- Footer content
Integration with Other Skills
- cro-auditor — CRO audit generates test hypotheses; this skill designs the experiments
- google-analytics — GA4 for experiment data and segment analysis
- copywriting-frameworks — Generate variant copy using proven frameworks
1---2name: ab-testing-framework3description: A/B and multivariate testing methodology. Design experiments, calculate sample sizes, determine statistical significance, avoid common pitfalls, and interpret results. Platform-agnostic framework applicable to landing pages, emails, ads, pricing, and product features. Use when the user asks about A/B testing, split testing, experiment design, statistical significance, or conversion experiments.4license: MIT5origin: custom6author: Rebecca Rae Barton7author_url: https://github.com/thatrebeccarae8metadata:9 source: https://skillmd.com/skills/thatrebeccarae/ab-testing-framework10 version: 1.0.011 category: analytics12 domain: experimentation13 updated: 2026-03-1814 tested: 2026-03-1815 tested_with: "Claude Code v2.1"16---1718# A/B Testing Framework1920Design, run, and analyze conversion experiments with statistical rigor.2122## Install2324```bash25git clone https://github.com/thatrebeccarae/claude-marketing.git && cp -r claude-marketing/skills/ab-testing-framework ~/.claude/skills/26```2728## Test Design Process2930### Step 1: Hypothesis3132**Template:** If we [change X], then [metric Y] will [increase/decrease] by [Z%] because [reason].3334**Good hypothesis:** "If we change the CTA from Get Started to Start Free Trial, then signup rate will increase by 15% because it reduces uncertainty about cost."3536**Bad hypothesis:** "If we change the button color, conversions will improve." (No reasoning, no expected magnitude.)3738### Step 2: Sample Size Calculation3940To determine how long to run a test:4142```43Required sample per variation = 16 * (p * (1-p)) / (MDE^2)4445Where:46 p = baseline conversion rate (as decimal)47 MDE = minimum detectable effect (as decimal)48```4950| Baseline Rate | 10% MDE | 20% MDE | 30% MDE |51|--------------|---------|---------|---------|52| 1% | 253,414 | 63,354 | 28,157 |53| 3% | 82,369 | 20,592 | 9,152 |54| 5% | 48,640 | 12,160 | 5,404 |55| 10% | 23,040 | 5,760 | 2,560 |56| 20% | 10,240 | 2,560 | 1,138 |5758**Minimum test duration:** 2 full business weeks (to capture day-of-week effects), even if sample size is reached sooner.5960### Step 3: Test Execution Rules61621. **Random assignment** — visitors must be randomly assigned to control/variant632. **No peeking** — do not check results before reaching sample size643. **No mid-test changes** — do not modify variants during the test654. **Even traffic split** — 50/50 for A/B, even splits for multivariate665. **Single variable** — change only one thing per test (unless multivariate)676. **Full duration** — run for the pre-calculated duration, not until significance6869### Step 4: Statistical Analysis7071#### Frequentist Approach7273**Z-test for proportions:**74```75Z = (p1 - p2) / sqrt(p_pooled * (1 - p_pooled) * (1/n1 + 1/n2))7677Where:78 p1, p2 = conversion rates of control and variant79 p_pooled = (x1 + x2) / (n1 + n2)80 n1, n2 = sample sizes81```8283**p-value interpretation:**84- p < 0.05: Statistically significant (95% confidence)85- p < 0.01: Highly significant (99% confidence)86- p >= 0.05: Not significant — do not declare a winner8788#### Bayesian Approach8990**When to use Bayesian:**91- Low traffic (small sample sizes)92- Need to make decisions faster93- Want probability of each variant being best (not just "significant or not")9495**Interpretation:** "There is a 94% probability that Variant B is better than Control" vs frequentist "We reject the null hypothesis at 95% confidence."9697### Step 5: Decision Framework9899| Result | Significance | Action |100|--------|-------------|--------|101| Variant wins | p < 0.05 | Implement variant |102| Control wins | p < 0.05 | Keep control, learn from failure |103| No difference | p >= 0.05 | Keep control, test something bigger |104| Variant wins | p = 0.05-0.10 | Consider traffic — may need more time |105106## Common Testing Pitfalls1071081. **Peeking** — checking results early inflates false positive rate from 5% to 26%+1092. **Stopping early** — reaching significance != reaching required sample size1103. **Testing too many variants** — each variant needs full sample size1114. **Ignoring segments** — overall winner may be loser for key segments1125. **Too small an effect** — testing for 2% lift needs enormous sample sizes1136. **Not accounting for seasonality** — run full weeks, avoid holidays1147. **Multiple metrics** — primary metric must be pre-declared; secondary are directional1158. **Survivorship bias** — only measuring users who complete, not those who abandon1169. **Simpson paradox** — segment-level winners can reverse at aggregate level11710. **Novelty effect** — new designs get temporary lift; re-test after 2-4 weeks118119## What to Test (Prioritized by Impact)120121### High Impact122- Value proposition / headline123- CTA text and placement124- Pricing and offer structure125- Form length (fields removed)126- Page layout (single column vs multi)127- Social proof presence and placement128129### Medium Impact130- Image/video vs static131- Testimonial format (text vs video)132- Navigation presence on landing pages133- Trust badges and security signals134- Urgency elements (countdown, stock)135136### Low Impact (Usually Not Worth Testing)137- Button color (unless extreme contrast issue)138- Font changes139- Minor copy tweaks140- Icon styles141- Footer content142143## Integration with Other Skills144145- **cro-auditor** — CRO audit generates test hypotheses; this skill designs the experiments146- **google-analytics** — GA4 for experiment data and segment analysis147- **copywriting-frameworks** — Generate variant copy using proven frameworks