Slide 1

Slide 1 text

Feature FlagΛద੾ʹ෼ྨ͢Δ ͜ͱͰA/Bςετͷӡ༻ίετ ΛԼ͛Δ iOSDC 2020 2020/09/21 Takeshi Ihara (ABEMA)

Slide 2

Slide 2 text

A/Bςετ ίϯςϯπ഑৴ܕαʔϏεʹ͓͍ͯɺ৽ػೳͷϦϦʔεͷࡍɺKPIͷม Խ͕৽ػೳʹΑΔӨڹ͔ίϯςϯπʹΑΔӨڹ͔ͷ۠ผ͕ࠔ೉ ৽ػೳͷޮՌଌఆͷਫ਼౓޲্ͷͨΊɺ৽ػೳͷ༗ແҎ֎ͷཁҼΛۃྗഉ আ͢Δ͜ͱ͕Ͱ͖ΔA/Bςετ͕༻͍ΒΕΔ

Slide 3

Slide 3 text

ABEMAʹ͓͚Δ৽ػೳͷA/Bςετ • ৽ػೳͷදࣔͷ੾Γସ͑ͷΈ • ϦϦʔεͷલʹଌఆࢦඪͱωΫετΞΫγϣϯΛࡦఆ A. ৽ػೳͷImp/Click (= දࣔ਺/ར༻਺) B. ؔ࿈ػೳͷImp/Click C. ࢹௌ࣌ؒ΍ࢹௌຊ਺ (KPI)

Slide 4

Slide 4 text

Feature Flag • ίʔυ্Ͱಛఆػೳͷදࣔͷ੾Γସ͑ʹ༻͍ΒΕΔ • Feature Toggle, Feature Switchͱ΋ݺ͹ΕΔ • ؅ཧαʔϏεͷྫ A. Firebase A/B Testing B. Launch Darkly

Slide 5

Slide 5 text

A/Bςετ + Feature Flagͷεςʔλε؅ཧ • A/Bςετͷ਺ = Feature Flagͷ਺͕૿͍͑ͯ͘ʹैͬͯɺ֤A/Bςε τʹΑΔίʔυ্ͷ෼ذʹΑΓঢ়ଶͷ਺͕ංେԽ͍ͯ͘͠ • A/Bςετ + Feature FlagͷεςʔλεΛ؅ཧ͠ͳ͍ͱɺະ࣮ࢪͷA/ Bςετ͕ຊ൪ʹ࿐ग़ͨ͠ΓɺݕূࡁͷA/Bςετ͕ίʔυ্ʹ࢒Γ ଓ͚Δ໰୊͕ൃੜ͠͏Δ

Slide 6

Slide 6 text

https://martinfowler.com/articles/feature-toggles.html Feature toggles can be categorized across two major dimensions: how long the feature toggle will live and how dynamic the toggling decision must be.

Slide 7

Slide 7 text

Feature Flagͷ෼ྨ (ΫϥΠΞϯτ) • Release Flag • Ops Flag • Permission Flag • Experiment Flag

Slide 8

Slide 8 text

Release Flag • ຊ൪؀ڥͰܾͯ͠༗ޮʹͳΒͳ͍࣮૷த΍ະςετͷػೳʹରͯ͠ͷ Feature Flag • τϥϯΫϕʔε։ൃͱ૬ੑ͕ྑ͍ • ੜଘظؒ) ୹͍ • มߋن໛) খ ~ த • ྫ) ։ൃதͷ৽ػೳ

Slide 9

Slide 9 text

Ops Flag • γεςϜͷಈ࡞Λ੍ޚ͢ΔͨΊͷFeature Flag • ੜଘظؒ) ௕͍ • มߋن໛) খ ~ த • ྫ) ಈըϓϨΠϠʔͷΤϥʔ࣌ͷϦτϥΠִؒ

Slide 10

Slide 10 text

Permission Flag • ಛఆͷϢʔβʔ͕ड͚औΔػೳ΍੡඼ମݧΛมߋ͢ΔFeature Flag • ੜଘظؒ) ୹͍ • มߋن໛) େ • ྫ) VoiceOverͷମݧ޲্ͷͨΊͷϢʔβʔςετ

Slide 11

Slide 11 text

Experiment Flag • ύϑΥʔϚϯεଌఆ΍A/BςετͷͨΊͷFeature Flag • ੜଘظؒ) ୹͍ • มߋن໛) த ~ େ • ྫ) ϦϦʔεࡁΈͷ৽ػೳ

Slide 12

Slide 12 text

ੜଘظؒ มߋن໛ 3FMFBTF'MBH &YQFSJNFOU'MBH 0QT'MBH 1FSNJTTJPO 'MBH

Slide 13

Slide 13 text

Code of Feature Flag enum FeatureFlag { case release(id: String, defaultValue: Value) case ops(id: String, defaultValue: Value) case permission(id: String, defaultValue: Value) case experiment(id: String, defaultValue: Value) var value: Value { #if DEBUG_MENU // DEBUGϝχϡʔͰઃఆ͞Εͨ஋͕͋Ε͹ฦ٫͢Δ #endif if case let .release(_, defaultValue) = self { return defaultValue } else { // ؅ཧπʔϧ͔Βऔಘͨ͠஋͕͋Ε͹ฦ٫͢Δɺͳ͚Ε͹ defaultValueΛฦ٫͢Δ } } } ΫϥΠΞϯτଆͰͷ࣮૷

Slide 14

Slide 14 text

·ͱΊ • ΫϥΠΞϯτଆͰFeature FlagΛ4छྨʹ෼ྨ A. ؅ཧπʔϧʹґଘ͠ͳ͍ B. ຊ൪؀ڥͰͷ։ൃ్தͷ࿐ग़Λ๷͛Δ • ఆظతʹFeature Flagͷ୨Է͕͠ඞཁ C. ߴස౓) Release Flag, Experiment Flag D. ௿ස౓) Ops Flag, Permission Flag