Problem
Coupang runs hundreds of A/B tests every day in its mobile app, and engineers ship tens of feature versions for tests each week. 80% of its mobile technical incidents came from A/B tests. Rolling back the B logic did not fix many of them, because A and B code were not separated by experiment conditions. Checking by hand whether a diff touches A logic is slow, and reviewers could not catch every error.
Example from the article: during an incident the team reverted all users to A logic, but the problem stayed, because turning off B logic had also changed A logic.
Solution in brief
A CI job runs on each pull request and compares the old and new code as syntax trees. Rules for each kind of change decide which nodes can alter A logic, and the job comments on those lines for the author and the reviewer. After rollout, violations per thousand lines fell from 22.6 to 16.5.
Questions this case answers
- How to verify automatically that a code change under experiment leaves the control path untouched, when manual review cannot keep up with the number of experiment versions shipped each week
- How to make sure that rolling back the B logic of an A/B test fully restores the original behavior
- How to detect, before an experiment starts, code changes that alter the control (A) logic
- How to cut technical incidents caused by many simultaneous A/B tests in a mobile app
Tools and methods
- Git diff — finds added, modified and deleted lines and files.
- AST diff — maps nodes between old and new code and labels each as added, modified, moved or deleted.
- Rule-based analysis per operation type — decides whether a changed node can alter A logic.
- CI job with pull-request comments — shows the warnings during code review.
Google or a one-time email code. No password.