Lesson 3 of 8
A/B Testing & Experimentation
A/B testing is the scientific method applied to design - it's how you move from 'we think this design is better' to 'this design is statistically proven to be better for 95% of our users.' Companies like Booking.com run 1,000+ simultaneous A/B tests. Amazon credits A/B testing with a significant portion of their revenue growth. But A/B testing is often done wrong - testing too many variables, running tests too briefly, and misinterpreting results. This topic teaches rigorous experimentation methodology that produces reliable, actionable results.
The Scientific Method for Design
- Step 1 - Hypothesis formation: 'We believe [change] will cause [result] because [evidence/reasoning].' Never test without a hypothesis rooted in data or research: 'We believe changing the CTA from ''Sign up free'' to ''Start for free'' will increase signup conversion because users misinterpret ''Sign up free'' as requiring a credit card (from session recordings showing hesitation on this step)'
- Step 2 - Define success metric: One primary metric (signup conversion rate), one or two guardrail metrics (churn rate, revenue per user - ensure you don't improve the primary metric by hurting something else). Never add metrics after seeing results
- Step 3 - Calculate sample size: Use a sample size calculator. For 80% statistical power and 95% confidence interval detecting a 10% relative improvement on a 5% baseline conversion rate, you need approximately 20,000 users per variant. Most teams run tests with insufficient sample sizes and draw false conclusions
- Step 4 - Run the test: 50% of users see Control (A), 50% see Variant (B). Allocate randomly at the user level (not session level) to prevent the same user seeing both versions. Run for a minimum of 2 full business cycles (typically 2 weeks) regardless of when you hit sample size - to account for weekly behavioral patterns
- Step 5 - Analyze and decide: If p < 0.05 and you've hit your pre-determined sample size, the result is statistically significant. Implement if positive, discard if negative. If inconclusive (no significant difference), the null hypothesis stands - the change doesn't help enough to justify implementation complexity
What to Test and What Not to Test
A/B testing is powerful for validating specific UI changes: button copy, CTA placement, hero headline, form field count, pricing page layout, notification timing. It's NOT effective for major redesigns (too many variables change simultaneously), low-traffic pages (insufficient sample size in any reasonable timeframe), or subjective brand decisions (A/B testing will tell you what converts, not what builds the right brand perception). Good A/B test candidates: signup flow CTA text (variant: 'Get started free' vs control: 'Create account'), onboarding email send timing (variant: 1 hour after signup vs control: immediately), checkout button color (variant: high-contrast green vs control: brand blue), pricing page layout (variant: monthly-first vs control: annual-first). Bad A/B test candidates: full homepage redesign (too many simultaneous changes), logo color (low business impact, high brand impact), font changes (impact takes months to measure in retention data).
A/B Testing & Experimentation: Visual guide and core principles.
A/B Testing Tools & Statistical Validity
- Optimizely: Enterprise A/B testing platform with advanced segmentation and multi-page experiments. Used by Microsoft, IBM, and major e-commerce sites. Expensive but the most robust
- VWO (Visual Website Optimizer): Mid-market tool with visual editor (no-code test setup), heatmaps, and session recordings integrated. Good for landing page optimization
- Google Optimize was deprecated as of 2023. Google now recommends Optimizely or AB Tasty for site-level testing
- Statsig / LaunchDarkly: Developer-focused feature flag + A/B testing platforms. Test features in production behind flags - no deploy needed for rollback. Standard at modern software companies
- Statistical significance vs practical significance: A test might reach 95% statistical significance (+12% conversion) but only after 6 months of data collection - the opportunity cost of waiting may exceed the gain. Use Bayesian analysis (Optimizely's default since 2018) for faster, more nuanced decision-making than frequentist p-values
- The peeking problem: Looking at live test results and stopping early when you see a positive result inflates false positive rates dramatically. Pre-commit to a sample size and stick to it - early positive results are often statistical noise
Tip
Tip
Practice AB Testing Experimentation in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.
Practice Task
Note
Practice Task - (1) Write a working example of AB Testing Experimentation from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.
Quick Quiz
Common Mistake
Warning
A common mistake with AB Testing Experimentation is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready ui ux code.
Key Takeaways
- A/B testing is the scientific method applied to design - it's how you move from 'we think this design is better' to 'this design is statistically proven to be better for 95% of our users.
- Step 1 - Hypothesis formation: 'We believe [change] will cause [result] because [evidence/reasoning].' Never test without a hypothesis rooted in data or research: 'We believe changing the CTA from ''Sign up free'' to ''Start for free'' will increase signup conversion because users misinterpret ''Sign up free'' as requiring a credit card (from session recordings showing hesitation on this step)'
- Step 2 - Define success metric: One primary metric (signup conversion rate), one or two guardrail metrics (churn rate, revenue per user - ensure you don't improve the primary metric by hurting something else). Never add metrics after seeing results
- Step 3 - Calculate sample size: Use a sample size calculator. For 80% statistical power and 95% confidence interval detecting a 10% relative improvement on a 5% baseline conversion rate, you need approximately 20,000 users per variant. Most teams run tests with insufficient sample sizes and draw false conclusions
Finished this lesson?