Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The swifter way of A/B testing implementation
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
gaopin
March 08, 2018
Technology
1.7k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The swifter way of A/B testing implementation
Try! Swift after talks
gaopin
March 08, 2018
More Decks by gaopin
See All by gaopin
draft for devsummi
gaopin1534
0
160
XCTestを目的別で分けるすすめ
gaopin1534
0
3.5k
静的解析の話
gaopin1534
0
190
RxSwiftってどうなってるの?
gaopin1534
1
320
Drag'n'Drop'n'iPhone
gaopin1534
0
150
OBJ-C戦線異常なし@DevLOVE 199
gaopin1534
1
150
Other Decks in Technology
See All in Technology
SO-101×VLAによる3色キューブのピック&プレース
abeja
0
180
Webアクセシビリティ入門 2026
recruitengineers
PRO
3
500
【AG-UI × A2UI × MCP Apps】Generative UIをやさしく解説する
nrinetcom
PRO
1
110
Forza Horizon 6 のテレメトリ機能で 自動運転に使えそうな学習データを集める話
henjin0
0
160
AIは実装を速くする。では、私たちは何を今作るべきか?-立場を越えてリリースに向き合ったチーム開発の実践 / 20260801 Hiromi Nakaya and Naoki Takahashi
shift_evolve
PRO
3
480
強化学習「理論」入門
enakai00
3
3.6k
Issue設計から始める仕様駆動開発 / 20260731 Mizuki Hirata
shift_evolve
PRO
1
160
Service Connect 上のサービスに ECS Service の外側から到達できなかった話
ota1022
1
220
メルカリのグローバルアプリで挑んだ AlloyDB 運用と課題解決の実践記
hatappi
0
240
制約理論(ToC)入門 2026版
recruitengineers
PRO
8
2.1k
取引先から届く 「セキュリティチェックシート」の読み解き方
kamadamakoto
0
140
攻撃と防御で学ぶAI時代のプロダクトセキュリティ演習
recruitengineers
PRO
9
2.4k
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
790
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
480
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Designing for Timeless Needs
cassininazir
1
440
Being A Developer After 40
akosma
91
590k
Amusing Abliteration
ianozsvald
1
240
Claude Code のすすめ
schroneko
67
230k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
440
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
590
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
380
Transcript
The swifter way of A/B testing implementation Kouhei Takamatsu(@gaopin1534)
ࣗݾհ • ߴদฏ(gaopin1534) • ਓࡐܥاۀۈ • iOSྺ1͘Β͍ • ͱͱPHPͱ͔Rubyͱ͔ͱྑ͠ •
try! Swift2018ϘϥϯςΟΞελοϑͯ͠·ͨ͠ • ΟεΩʔͱ͔Ϗʔϧ͕͖
by Martin Abegglen (https://goo.gl/VwaMZP)
ABςετ by Silly Deity (https://goo.gl/HsJgy3)
͍ࣺͯͷfunc طଘϩδοΫΛԚછ͢Δذ ͿΒΓABςετআ٫ͷཱྀ ԿͷABςετͬͯΔΜ͚ͬʁ ͦͷABɺςετίʔυॻ͚Δʁ ςετίʔυ͍ͦͦΔʁ
໘͍͘͞
ष͍ͷʹ֖ by Erwin Soo (https://goo.gl/1AS3mE)
ABTesterProtocol associatedtype ABTestPatternType: ABTestPatternProtocol associatedtype ABTestKey: ABTestKeyProtocol func getCurrentPatternKey() ->
ABTestKey A/B test logic functions extension ABTesterProtocol { private func getTargetPattern() -> ABTestPatternType? { return getCurrentPatternKey().pattern as? Self.ABTestPatternType } }
ABTesterKeyProtocol: RawRepresentable associatedtype ABTestPatternType: ABTestPatternProtocol var pattern: ABTestPatternType { get
} ϩάͱͷ࿈݁͘͢͠ɺ ͔ͭenum͑ΑײΛग़ͨ͢Ί RawRepresentableʹ४ڌ
ABTesterPatternClass: ABTestPatternProtocol ॻ͘ABςετύλʔϯ͝ͱʹ࣮ ࣮ࡍͷϩδοΫશ෦͜͜ʹ DefaultΛҰͭ࡞Γɺଞύλʔϯͦͷࢠʹ શύλʔϯΫϥε͕ಉ͡funcΛ࣋ͭͷ͕ຯḩ A/B test logic functions
class CertainABTestPatternDefault: ABTestPatternProtocol { func getLabel() -> String { return
"Live long and prosper." } } class CertainABTestPatternB: CertainABTestPatternDefault { override func getLabel() -> String { return "May the force be with us.” } }
struct CertainABTester: ABTesterProtocol { func getCurrentPatternKey() -> SomeABTestKey { return
.a } typealias ABTestPatternType = SomeABTestPatternDefault typealias ABTestKey = SomeABTestKey func getLable() -> String { return getCurrentPatternKey().pattern.getLabel() } }
SomeTester: ABTesterProtocol SomeTestKey: ABTestKeyProtocol var patternͰબ getCurrentKey PatternDefault: ABTestPatternProtocol PatternB:
PatternDefault ϩδοΫݺͿ ᶃ ᶄ ᶅ
if ABTestManager().getPattern(of: .someABTest) == "B" { label.text = "foo" }
else { label.text = "bar" } ͜Ε͕
lebel.text = SomeABTester().getLabel() ͜͏ͳΔ
Կ͕خ͍͠ʁ • ύλʔϯΛফͯ͠Default͕ੜ͖ͯΕͱΓ͋͑ͣյ Εͳ͍ • ABςετ୯ҐͰཧͰ͖ͯɺશ෦ด͡ࠐΊΕΔ • ABͲ͔ͬͪʹدͤΔͱ͖έʔεΛফ͚ͩ͢ • ύλʔϯআ࣌ʹABTesterͬͯ͠·͏͕ɺޙʑফ
͖͢ͷ͕ϚʔΩϯάͰ͖͍ͯΔঢ়ଶʹͳ͍ͬͯΔ
Կ͕೦ʁ • ϦϑΝΫλ͢Δ༐ؾ͕ͳ͚ΕӬԕʹABTester͕ Γଓ͚Δ • ͠͠ҾͰselfͱ͔Λ͢ඞཁ͕͋Δ • ໘͍͘͞ͷͰಋೖ࣌ʹݏ͕ΒΕΔ • Ұ൪ൃද͔ͨͬͨ͠ʮSwiftͰ࣏ฤʯʹଓ͘
https://github.com/ gaopin1534/Yebisw ࡞Γ్தͰ͕͢ɺɺɺ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠