Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOSDC20200921: Feature Flagを適切に分類することでA/Bテストの運用...

Takeshi Ihara
September 21, 2020

iOSDC20200921: Feature Flagを適切に分類することでA/Bテストの運用コストを下げる

Takeshi Ihara

September 21, 2020
Tweet

More Decks by Takeshi Ihara

Other Decks in Programming

Transcript

  1. A/Bςετ + Feature Flagͷεςʔλε؅ཧ • A/Bςετͷ਺ = Feature Flagͷ਺͕૿͍͑ͯ͘ʹैͬͯɺ֤A/Bςε τʹΑΔίʔυ্ͷ෼ذʹΑΓঢ়ଶͷ਺͕ංେԽ͍ͯ͘͠

    • A/Bςετ + Feature FlagͷεςʔλεΛ؅ཧ͠ͳ͍ͱɺະ࣮ࢪͷA/ Bςετ͕ຊ൪ʹ࿐ग़ͨ͠ΓɺݕূࡁͷA/Bςετ͕ίʔυ্ʹ࢒Γ ଓ͚Δ໰୊͕ൃੜ͠͏Δ
  2. 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.
  3. Code of Feature Flag enum FeatureFlag<Value> { 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Λฦ٫͢Δ } } } ΫϥΠΞϯτଆͰͷ࣮૷
  4. ·ͱΊ • ΫϥΠΞϯτଆͰFeature FlagΛ4छྨʹ෼ྨ A. ؅ཧπʔϧʹґଘ͠ͳ͍ B. ຊ൪؀ڥͰͷ։ൃ్தͷ࿐ग़Λ๷͛Δ • ఆظతʹFeature

    Flagͷ୨Է͕͠ඞཁ C. ߴස౓) Release Flag, Experiment Flag D. ௿ස౓) Ops Flag, Permission Flag