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
gaopin
March 08, 2018
Technology
2
1.4k
The swifter way of A/B testing implementation
Try! Swift after talks
gaopin
March 08, 2018
Tweet
Share
More Decks by gaopin
See All by gaopin
draft for devsummi
gaopin1534
0
140
XCTestを目的別で分けるすすめ
gaopin1534
0
3.3k
静的解析の話
gaopin1534
0
170
RxSwiftってどうなってるの?
gaopin1534
1
310
Drag'n'Drop'n'iPhone
gaopin1534
0
130
OBJ-C戦線異常なし@DevLOVE 199
gaopin1534
1
130
Other Decks in Technology
See All in Technology
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
200
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
10
1.2k
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.9k
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
320
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
Zennのパフォーマンスモニタリングでやっていること
ryosukeigarashi
0
160
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
900
Platform Engineering for Software Developers and Architects
syntasso
1
520
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
230
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
160
DynamoDB でスロットリングが発生したとき/when_throttling_occurs_in_dynamodb_short
emiki
0
260
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.4k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Documentation Writing (for coders)
carmenintech
65
4.4k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Code Review Best Practice
trishagee
64
17k
Rails Girls Zürich Keynote
gr2m
94
13k
Docker and Python
trallard
40
3.1k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
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 ࡞Γ్தͰ͕͢ɺɺɺ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠