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

自作アプリにテストを導入する為にMVP化した話

Tatsuya Kainuma
December 19, 2017
430

 自作アプリにテストを導入する為にMVP化した話

Tatsuya Kainuma

December 19, 2017
Tweet

Transcript

  1. ࣗ࡞ΞϓϦʹςετΛಋೖ͢Δҝʹ
    MVPԽͨ͠࿩
    'SJ

    "OESPJE5FTU/JHIU
    ͦͯ͠ݟ͑ͯ͘Δؾ͖ͮ

    View full-size slide

  2. 5FTU/JHIUͷօ͞Μɺ͸͡Ί·ͯ͠
    ໊લɿ։পୡ໵
    5XJUUFS
    !OVNB@QPJOTFUJB
    w ઋ୆͔Β্ژͯ͠೥൒͘Β͍
    w ͓࢓ࣄ͸ৗறܕͷҕୗ
    w "QQMF৴ऀͷ"OESPJEΤϯδχΞ

    View full-size slide

  3. ࠷ۙɺΞϓϦΛϑϧεΫϥον
    Ͱ࡞Δػձͳ͘ͳͬͨͳ͊ʜ
    ŇP0 ΋͔ͯ͠͠ɺ࡞Γํ๨ΕͯΔͷͰ͸ʁ

    View full-size slide

  4. িಈͷ··ʹ೔هΞϓϦͷ։ൃελʔτ

    View full-size slide

  5. ͱΓ͋͑ͣಈ͍ͨ
    w ϦετΞΠςϜͷ௥Ճػೳ
    w εϫΠϓ࡟আػೳ
    w ௕ԡ͠ͰϦετೖΕସ͑ػೳ
    w 3FBMN%#ͰσʔλΛอ࣋

    View full-size slide

  6. ͓΍ʁ༷ࢠ͕ɾɾɾ
    'SBHNFOUKBWB

    View full-size slide

  7. ͱͯ΋ςετΛॻ͚Δίʔυ͡Όͳ͍
    ʗ ?P?
    ʘ

    View full-size slide

  8. .71Խ͢ΔͳΒࠓ͔͠ͳ͍ͷͰ͸

    ŇP0 'SBHNFOU͸දࣔʹઐ೦ͤ͞Α͏

    ŇP0 %#ૢ࡞͸3FQPTJUPSZʹઐ೦ͤ͞Α͏

    ŇP0 Πϕϯτͷૢ࡞͸1SFTFOUFSʹઐ೦ͤ͞Α͏



    View full-size slide

  9. ŇP0 ͖ͬͱςετ͸1SFTFOUFSʹ͚ͩॻ͚͹
    େৎ෉ͳ͸ͣͩ

    View full-size slide

  10. ޙੈʹ࢒ͨ͢Ίʹ.71Խͷ޻ఔΛ౤ߘ͠ଓ͚ͨ
    ˌશճͷهࣄʹͳΓ·ͨ͠

    View full-size slide

  11. .71Խͷ׬੒
    ˌ͜͜·ͰͰϲ݄͔͔Γ·ͨ͠

    View full-size slide

  12. ࠓ౓ͦ͜ςετΛॻ͍ͯΈͨ
    •FragmentͱRepositoryΛ
    େ୾ʹMockԽ

    #MockitoΛ࢖༻
    •RealmDB͕༧ఆ௨Γͷ஋
    Λฦ٫ͨ࣌͠ɺ૝ఆͨ͠
    ϧʔτΛ௨͍ͬͯΔ͔

    View full-size slide

  13. ϦετೖΕସ͑Πϕϯτॲཧ
    1FSTPO1SFTFOUFSKBWB
    1FSTPO3FQPTJUPSZKBWB

    View full-size slide

  14. ࠓճͷؾ͖ͮʹ͍ͭͯ

    View full-size slide

  15. ·ͱΊ
    w 'BUͳ'SBHNFOUͷअѱ͞Λ࠶ೝࣝ
    w ޻ఔΛΞ΢τϓοτ͢Δ͜ͱ͸ɺϞνϕͷܧଓʹܨ͕Δ
    w ςετΛॻ͜͏ͱ͢Δ޻ఔࣗମʹɺҙຯ͕͋Δ

    View full-size slide