100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Python

A/B Testing Basics

How splitting users into control and treatment groups and comparing outcomes with statistical significance testing reveals a change's true effect.

Applied TopicsIntermediate10 min readJul 26, 2026
Analogies

Introduction

A/B testing compares two versions of something, typically labeled A (the control, or existing version) and B (the treatment, or new version), by randomly assigning different users to each version and measuring a chosen outcome, such as click-through rate or conversion rate. The random assignment is the crucial part: because users are split into groups by chance rather than by any characteristic of their own, any consistent difference in outcome between the groups can be attributed to the change being tested rather than to pre-existing differences between the kinds of users who ended up in each group.

🏏

Cricket analogy: A coach testing a new batting stance doesn't let players choose which stance to try; players are randomly assigned to the old or new stance, so any difference in scoring afterward reflects the stance itself rather than which players happened to prefer trying something new, just as A/B testing relies on random assignment.

Explanation

After running the test and observing a difference between group A's and group B's conversion rates, the next question is whether that difference reflects a real effect of the change or could plausibly have arisen just from random variation in which users happened to land in each group. A statistical significance test, most commonly a two-proportion z-test or chi-squared test for conversion-rate comparisons, computes a p-value: the probability of seeing a difference at least as large as the one observed if there were truly no difference between A and B. A small p-value, conventionally below 0.05, is taken as evidence that the observed difference is unlikely to be due to chance alone.

🏏

Cricket analogy: Seeing one net-session's batting average beat another's by a few runs doesn't prove a new stance works; a significance test asks how likely that gap is from pure day-to-day variation if the stance made no real difference, the same logic behind an A/B test's p-value.

A p-value below the chosen threshold does not, by itself, guarantee the effect is large enough to matter practically, since with a large enough sample size even a tiny, commercially irrelevant difference can become statistically significant; this is why effect size, the actual magnitude of the difference such as a two-percentage-point lift in conversion, should always be reported alongside the p-value. Sample size must also be planned before running the test through a power analysis, which estimates how many users are needed in each group to reliably detect an effect of a meaningful size, since a test that is stopped too early or run with too few users risks concluding there is no effect when a real one simply could not be detected with the available data.

🏏

Cricket analogy: A statistically significant half-run improvement in average across a huge number of net sessions might be real but too small to matter for team selection; effect size alongside significance is what matters, and a coach needs enough net sessions planned upfront to reliably detect a meaningful change, the same logic behind power analysis.

Example

python
import numpy as np
from statsmodels.stats.proportion import proportions_ztest

# Illustrative example counts, not real data
conversions = np.array([120, 150])   # [A, B]
sample_sizes = np.array([2000, 2000])  # [A, B]

z_stat, p_value = proportions_ztest(conversions, sample_sizes)
lift = conversions[1] / sample_sizes[1] - conversions[0] / sample_sizes[0]

print(f"lift: {lift:.3%}, p-value: {p_value:.4f}")

Analysis

In this illustrative example, group A converts at 6.0 percent and group B at 7.5 percent, a lift of 1.5 percentage points; whether that lift is reported as statistically significant depends entirely on the p_value computed by proportions_ztest, which accounts for both the size of the lift and the sample size in each group. If the same 1.5-point lift had been observed with sample sizes of 200 rather than 2000 per group, the same test would very likely produce a much larger p-value, illustrating that a promising-looking raw difference is not evidence of a real effect until it has been checked against a properly sized, randomly assigned test.

🏏

Cricket analogy: In an illustrative example, a coach's small net-group trial might show one stance scoring higher, but with only a handful of sessions the same test would likely show a much weaker significance than the identical lift measured across a full season's worth of sessions.

Key Takeaways

  • A/B testing randomly assigns users to a control (A) and a treatment (B) version to isolate the effect of the change being tested.
  • Random assignment is essential so any consistent outcome difference can be attributed to the change rather than pre-existing group differences.
  • A p-value estimates the probability of seeing an observed difference or larger if there were truly no effect; a small p-value suggests the difference is unlikely due to chance.
  • Statistical significance does not guarantee practical importance; effect size should always be reported alongside the p-value.
  • Sample size should be planned in advance through a power analysis so the test can reliably detect a meaningful effect.

Practice what you learned

Was this page helpful?

Topics covered

#Python#DataAnalysisStudyNotes#DataScience#ABTestingBasics#Testing#Explanation#Example#Analysis#StudyNotes#SkillVeris

Frequently Asked Questions

21 categories · pick one to explore

Where can I get free study notes for programming and tech subjects?
SkillVeris offers completely free study notes covering programming and tech subjects, with no signup fees or paywalls. The notes are structured by course and topic, written for quick understanding, and enriched with the Learn Through Hobbies analogy method, so you can revise concepts through cricket, music, gaming, cooking and more.
Are SkillVeris study notes good for exam revision?
Yes, the study notes are designed for efficient revision: each topic answers its heading immediately, keeps explanations concise, and links to related glossary terms and cheat sheets. Students preparing for university exams or certification tests use them as quick revision notes because they distil concepts without the padding of full textbooks.
What subjects do the free study notes cover?
The study notes span the platform's main domains, including AI and machine learning, Python and programming, web development, DevOps, cloud, security and databases. Coverage mirrors the 37 live courses, so notes exist for the topics you are actually studying, and new note sets are added as courses launch.
How are SkillVeris study notes different from regular textbooks?
The notes are answer-first, concise and free, whereas textbooks are long and often expensive. Each section explains one concept directly, then reinforces it through selectable hobby analogies like cricket or cooking. Notes also cross-link to the glossary, blog and cheat sheets, letting you jump to related material instantly instead of flipping pages.
Can I use the developer study material without creating an account?
The study notes are free to access, and SkillVeris does not charge anything for its developer study material at any point. Browsing notes is straightforward from the Study Notes section, and if you want progress tracking, certificates and AI Mentor conversations tied to your learning, a free account unlocks those extras.
Do the study notes explain concepts with analogies?
Yes, this is a signature SkillVeris feature. Study notes use the Learn Through Hobbies method, explaining technical concepts through analogies from twelve domains including cricket, music, gaming, photography, travel, movies, fitness, chess, cooking, finance, business and sports. You can switch the analogy domain instantly to whichever hobby makes the concept click.
Are the revision notes suitable for last-minute exam preparation?
Yes, revision notes on SkillVeris work well for last-minute preparation because every section states the answer in its first sentences, so skimming is genuinely effective. Pair them with the relevant cheat sheet for formulas and syntax, and use the glossary for any unfamiliar term you meet while cramming.
Is there free study material for AI and machine learning?
Yes, SkillVeris provides free study notes across its AI and ML catalogue, covering Python for AI, deep learning frameworks like PyTorch and TensorFlow, Hugging Face Transformers, Large Language Models, RAG, AI agents and MLOps. All of it is free, making it a strong resource for Indian students and global learners alike.
Can beginners understand the study notes, or are they for experts?
Beginners can absolutely use them. The notes are written in plain language, define terms as they appear, and lean on hobby analogies to make abstract ideas concrete. Difficulty scales with the underlying course level, so beginner-course notes stay gentle while advanced-course notes go deeper, and the glossary supports you throughout.
How do study notes connect with SkillVeris courses?
Study notes are organised by course and topic, so they map directly to the structured courses and their 24–40-lesson curriculum. Many learners study a lesson first, then use the matching notes for revision before module assessments and the final exam, where 80 percent is required to pass and earn the certificate.
Are there study notes for Python specifically?
Yes, Python is well covered through notes tied to the Python-focused courses, including Python for AI and ML. Topics span fundamentals through applied machine learning usage. You can reinforce the notes with Python practice in Code Lab, which runs code in your browser with no installation required.
Do the study notes include code examples?
Yes, study notes include code examples wherever a concept is best shown in code, alongside explanations, key points and analogies. Reading a snippet in the notes and then reproducing it yourself in Code Lab is an effective loop, since Code Lab lets you run code in the browser across six languages.
How often is new study material added to SkillVeris?
Study material grows alongside the course catalogue. Whenever new courses join the platform's 37 live courses, matching study notes, glossary entries and cheat sheets are added so the resources stay in sync. Existing notes are also refined over time, so it is worth revisiting topics you studied earlier.
Can I use SkillVeris notes to prepare for technical interviews?
Yes, the notes make excellent interview revision because they compress each concept into direct, answer-first explanations, which mirrors how you should answer interview questions. Combine them with the SkillVeris interview questions feature, which includes readiness scoring, to test whether your revision has actually made you interview-ready.
Are the study notes mobile-friendly for studying on the go?
Yes, the study notes are built to load fast and read comfortably on mobile devices, so you can revise during a commute or between classes. Sections are short and answer-first, which suits small screens, and analogy switching works on mobile too, letting you study anywhere without carrying books.
What is the difference between study notes and cheat sheets?
Study notes explain concepts in depth with context, examples and analogies, making them ideal for learning and revision. Cheat sheets are compact quick-reference summaries of syntax, commands and key facts, ideal once you already understand a topic. Most learners study the notes first, then keep the cheat sheet handy while coding.
Do study notes help if I am stuck on a course lesson?
Yes, reading the matching study notes often clarifies a lesson because the same concept is explained from a different angle, frequently with a different analogy. If you are still stuck, ask the AI Mentor, which answers 24/7 at Quick, Detailed or Deep-dive depth until the idea genuinely makes sense.
Is there free study material for DevOps and cloud topics?
Yes, SkillVeris carries free study notes for DevOps and cloud topics as part of its coverage across 37 live courses. The material suits learners following the DevOps Engineer or Cloud Engineer paths, and it links to related glossary terms and cheat sheets so you can revise the whole toolchain in one place.
Can school or college students in India use these notes for projects?
Yes, students across India and worldwide use SkillVeris notes for coursework, projects and exam preparation, and everything is free, which matters for student budgets. The notes explain concepts clearly enough to cite in project reports, and Code Lab lets you prototype the project code directly in your browser.
How should I combine study notes with other SkillVeris resources?
A proven loop: learn from a course lesson, revise with the matching study notes, look up unfamiliar terms in the glossary, keep the cheat sheet open while practising in Code Lab, and quiz yourself with interview questions. The AI Mentor fills any remaining gaps 24/7, at whatever depth you need.

What Learners Say

Real journeys from the SkillVeris community — swipe for more.

SkillVeris taught me Python through Cricket. Now I’m building real projects and feeling confident!
Arjun S. · B.Tech Student
The best platform for hobby-based learning. Concepts finally stick.
Priya R. · Data Analyst
I went from zero coding to a portfolio of projects — all by learning through my love for gaming. Landed my first internship!
Kabir M. · CS Undergraduate
Trending Topics50 popular tags — tap to explore
Trending CoursesAll 37 free courses — tap to browse