モバイルアプリ開発の "標準"を探る #CookpadTechConf
by
FUJI Goro
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
ϞόΠϧΞϓϦ։ൃͷ ඪ४Λ୳Δ $PPLQBE5FDI$POG SE+BO '6+*(PSPHPSPGVKJ!DPPLQBEDPN
Slide 2
Slide 2 text
͡Ίʹ • ໊લ • FUJI Goro (GitHub: gfx, Twitter: @__gfx__) • ෦ॺ • ٕज़෦ ϞόΠϧ։ൃج൫ • ۙگ • Ϛάωοτגࣜձࣾʹग़தʢ20159݄~ʣ
Slide 3
Slide 3 text
͜ͷτʔΫͷഎܠ • 20161݄ݱࡏɺΫοΫύουεϚϗλϒϨοτͳ ͲɺϞόΠϧͰͷΞΫηε͕աΛ͍͑ͯΔ • ͦΕΏ͑ʹϞόΠϧΞϓϦ։ൃͷن͕େ͖͘ͳͬͨ • ୯ҰͷAndroidΞϓϦɺiOSΞϓϦʹͷΈؔΘΔΤϯδ χΞ૬ରతʹগͳ͘ͳͬͨ • ҰํͰʮΫοΫύουʯαʔϏεͷण໋͕҆͘ఆ ͯ͠։ൃɾӡ༻Ͱ͖Δ͜ͱ͕ٻΊΒΕΔ
Slide 4
Slide 4 text
ϞόΠϧ͔ΒͷΞΫηεͷ༁ • PC vs εϚϗ • ΞΧϯτ࣋ͪϢʔβʮεϚϗͷΈʯ͕8ׂ • ήετϢʔβͷ͏ͪʮεϚϗʯ7ׂ • ΞϓϦ vs Σϒ • ΞΧϯτ࣋ͪϢʔβʮΞϓϦͷΈʯ͕6ׂ • ήετϢʔβͷ͏ͪʮΞϓϦʯ1ׂ
Slide 5
Slide 5 text
։ൃʹ͓͚Δʮඪ४ʯͱʁ • ʮඪ४తͳ։ൃʯΛʮޮՌͱίετͷόϥϯε͕Α ͘ೲಘײͷ͋Δ։ൃʯͱߟ͑Δ • ͭ·Γʮඪ४తͰͳ͍։ൃʯͱʮௐͯΘ͔Β ͳ͍ൿͷλϨ͕ଟ͘ɺཧෆਚʹײ͡Δ։ൃʯͱͳ Δ • ʮރΕٕͨज़ʯͷ͜ͱͱݶΒͳ͍ɻڥͷมԽʹ ͍͍ͭͯ͘͜ͱେࣄɻ
Slide 6
Slide 6 text
ΫοΫύουͷߟ͑Δ ඪ४తͳϞόΠϧΞϓϦ։ൃ w ৽ٕज़ͷಋೖ w $* 5FTU 2" w '54
Slide 7
Slide 7 text
৽ٕज़ͷಋೖ
Slide 8
Slide 8 text
͜͜Ͱ͍͏ʮ৽ٕज़ʯͱ • ϓϩάϥϛϯάݴޠʢe.g. Swiftʣ • ϑϨʔϜϫʔΫϥΠϒϥϦʢe.g. RxJavaʣ • ϓϩτίϧʢe.g. HTTP/2ʣ • σʔλϑΥʔϚοτʢe.g. WebPʣ • ΞʔΩςΫνϟʢe.g. MVVM, Clean Architectureʣ • ͦͷଞιϑτΣΞɾαʔϏε
Slide 9
Slide 9 text
৽ٕज़Λಋೖ͢Δͱ͍͏͜ͱ • جຊతʹੵۃతʹ࠾༻͢Δํ • ͦΕ͕Ͳ͏͍͏Λղܾ͢Δͷ͔Λ͖ͪΜͱ໌Β ͔ʹ͢Δ͜ͱ • ʮ͏ਓಋೖऀ͚ͩʯආ͚Δ͖ࣄଶ • ৽ٕज़ಋೖͷࡍࣾษڧձϒϩάͳͲͰੵۃ తʹܒ׆ಈΛߦͳ͍ͬͯΔ • cf. Android։ൃͰRxJavaΛνʔϜʹಋೖͨ͠
Slide 10
Slide 10 text
ಋೖࡁΈɾݕ౼தͷٕज़ • ಋೖࡁΈ • WebP, Shared Web Credentials, Smart Lock for Passwords, Retrolambda, Dokumi, Pull-Request Builder • ݕ౼த • Swift, Kotlin, fastlane, Issue Tracking System, CI as a Service (Travis, CircleCI)
Slide 11
Slide 11 text
ྫ4XJGU • 201512݄ʹOSSԽ͞ΕͨiOS༻ͷϓϩάϥϛϯάݴޠ • ৽نͰSwiftΛͬͨΞϓϦ͋Γ • طଘͷObjective-CΛॻ͖͑ΔͷҰྫ͚ͩ͋Γ • Global Cookpad iOS app • SwiftͷӨڹͰ࣮͞ΕͨObjective-Cͷ৽ػೳੵۃతʹ ͍ͬͯ͘ํʢͨͱ͑δΣωϦΫεʣ • AppleʹΑΓະདྷ͕ଋ͞Ε͍ͯΔ
Slide 12
Slide 12 text
ྫ,PUMJO • JetBrainsࣾͷ։ൃ͢ΔJVM༻ͷϓϩάϥϛϯάݴޠ • Android༻ͷϓϩάϥϛϯάݴޠͱͯ͠͞Ε͍ͯΔ • ߏจ (Java + Swift) / 2 ͱ͍ͬͨͱ͜Ζ • ݴޠ༷͔ͳΓΑ͘IDEͷαϙʔτे • ϥΠϯλΠϜͷϑοτϓϦϯτ1MBఔͱখ͞Ί • Javaͷࢿ࢈Λͦͷ··͑ͯίʔυྔJavaΑΓগͳ͍ • ͨͩ͜ΕʹΑͬͯʮԿΛղܾ͢Δͷ͔ʯ͖ͬΓͱ͠ͳ͍
Slide 13
Slide 13 text
$* 5FTU 2"
Slide 14
Slide 14 text
ϞόΠϧΞϓϦͷಛʢʣ • Ϣʔβʔ͕͏όʔδϣϯΛ੍ޚͰ͖ͳ͍ • Ϣʔβʔ͕ΞϓϦͷΞοϓσʔτΛ͢ΔͱݶΒͳ͍͠ɺ ࣮ࡍΞοϓσʔτΛ͠ͳ͍Ϣʔβ͍Δ • ʮΞοϓσʔτͷڧ੍ʯ͠ͳ͍ํͰ͖͍ͯΔ • Android৽͍͠ύʔϛογϣϯΛՃ͢ΔͱݦஶʹΞοϓ σʔτ͕͕͞Δ • ύʔϛογϣϯΛՃ͢ΔͱࣗಈΞοϓσʔτ͕ޮ͔ͳ ͘ͳΔͨΊɻAndroid 6.0Ͱվળ͞Ε͕ͨະීٴ
Slide 15
Slide 15 text
ϞόΠϧΞϓϦͷಛʢʣ • ࣮ߦڥΛ੍ޚ͢Δ͜ͱͰ͖ͳ͍ • ͷεϖοΫ / OSͷόʔδϣϯ / ௨৴ڥ· ͪ·ͪ • ΣϒΞϓϦΑΓࣦഊ͕ॏ͘ςετ͍͠ • ςετίʔυΣϒΞϓϦΑΓॻ͘ͷ͕͍͠ • ίʔυϨϏϡʔɾCIɾQAͳͲͷ࣭ཧ͕ॏཁ
Slide 16
Slide 16 text
$*+FOLJOT NVMUJTMBWFT • AndroidLinux/EC2 • iOSMac࣮ػ • Travis CI, Circle CIͳͲݕ౼͕ͨ͠ະಋೖ • ίετʹରͯͦ͜͠·Ͱར͕ͳ͍ͱ͍͏அ • ڥΛ੍ޚ͍͢͠ͱ͍͏རΛͱ͍ͬͯΔ
Slide 17
Slide 17 text
"OESPJE$*ϚγϯςετσόΠεͷมભ 1. EC2 + emulator 2. Macbook ProʢiOS CIͱಉ͡Ϛγϯʣ + ࣮ػ 3. ϋΠεϖοΫLinuxϚγϯ + ࣮ػ • εέʔϧΞοϓͰͦͦ͜͜շద 4. EC2 + emulator • ؆୯ʹεέʔϧΞτͰ͖ΔΑ͏ʹͨ͠ • ϨΠςϯγΑΓεϧʔϓοτΛͱͬͨ݁Ռ
Slide 18
Slide 18 text
1VMM3FRVFTU#VJMEFS • JenkinsͷpluginͰɺPR͝ͱʹCIΛىಈ͢Δ • master branchʹcommit / push͢Δͷېࢭ • Ϗϧυʴςετ͕ύε͠ɺϨϏϡʔΛ௨ͬͨΒϚʔδՄ
Slide 19
Slide 19 text
1VMM3FRVFTU#VJMEFS͕ߦ͏͜ͱ • Pull-Request Builder (+Dokumi) • ςετΛ࣮ߦͯ͠PRʹࣦഊϝοηʔδΛϙετ • ੩తղੳΛ࣮ߦͯ͠PRͷ֘ՕॴʹϝοηʔδΛϙετ • ػցʹίʔυϨϏϡʔͤͯ͞ਓͷෛ୲ΛݮΒ͢ • ΞϓϦύοέʔδΛϏϧυʢapk, ipaʣ • ΞϓϦύοέʔδΛDeployGateʹΞοϓϩʔυ • ΤϯδχΞҎ֎Ͱ։ൃதͷ৽ػೳΛࢼ͘͢͠
Slide 20
Slide 20 text
6OJU5FTU2" • ςετΤϯδχΞ2ਓମ੍ • 2ਓڞίʔυΛॻ͚Δ • ςετίʔυϓϥοτϑΥʔϜ͝ͱͷඪ४ςετϑϨʔ ϜϫʔΫʢAndroid JUnit4, XCTestʣ • ։ൃऀॻ͘͠ɺςετΤϯδχΞॻ͘ • AppiumπʔϧʹΑΔࣗಈԽ͞Εͨςετɺख࡞ ۀʹΑΔςετ࣮ࢪ
Slide 21
Slide 21 text
'BJMVSF5FBDIFT4VDDFTT
Slide 22
Slide 22 text
'BJMVSF5FBDIFT4VDDFTT • োϨϙʔτͷϑΥʔϚοτɿ • ʹ͍ͭͯνʔϜͰ͠߹͏͜ͱ • ͳͥͦͷΛൃੜͤͯͨ͞ͷ͔Λهࡌ͢Δ͜ͱ • ࠶ൃࢭࡦͱͦͷ࣮ࢪΛهࡌ͢Δ͜ͱ • ʮؾΛ͚Δʯʮҙ͢Δʯͱ͍ͬͨओ؍తͳ ࢭࡦೝΊͳ͍
Slide 23
Slide 23 text
'54ࢥߟͷϑϨʔϜϫʔΫ • ͕͋Εࠜຊతʹղܾ͖͢ͱ͍͏Ձ؍ • ʮͳͥ͜ͷ͕ى͖ͨͷ͔ʯΛੳٕͯ͠ज़తͳ ղܾࡦʹམͱ͜͠Ή • ։ൃʹ͓͚Δʮඪ४ʯΛ࡞͍ͬͯ͘աఔͰ͋Δ
Slide 24
Slide 24 text
࣮ࡍͷ'54͔Β ͍͔ͭ͘ϐοΫΞοϓ
Slide 25
Slide 25 text
"OESPJEΞϓϦͰ 8JEHFU͕͋Δͱ͖ʹ Ξοϓσʔτ͢ΔͱϩάΞτ
Slide 26
Slide 26 text
$PPLQBE"QQ8JEHFU • AndroidͷϗʔϜʹஔ͚Δ খ͍͞ΞϓϦ • ىಈϑϩʔ͕ී௨ͷΞϓ Ϧͱҧ͏ʢ͜ͱ͕͋Δʣ
Slide 27
Slide 27 text
8JEHFU͕͋Δͱ͖ʹΞοϓσʔτ͢ΔͱϩάΞτ • WidgetΛؚΊͯز͔ͭͷύλʔϯͰىಈϑϩʔ͕গ ͚ͩ͠ҧ͏ • ΞϓϦέʔγϣϯͷىಈ࣌ ʢApplication#onCreate()ʣʹͯ͢ͷॳظԽΛߦ͏ ͱ͗͢ΔͷͰɺผͷͱ͜ΖʹΓ͚͍ͯͨ • ݁Ռɺ௨ৗͱҧ͏ىಈϑϩʔΛऔΔ߹ʹͯ͢ͷ ॳظԽ͕Βͳ͍ঢ়ଶͩͬͨ
Slide 28
Slide 28 text
ղܾํ๏ • ॳظԽΛ Application#onCreate() Ͱߦ͏Α͏ʹͨ͠ • ͦͷࡍɺॳظԽϓϩηεΛݟͳ͓ͯ͠ߴԽͨ͠ • ͜ͷॳظԽεϓϥογϡεΫϦʔϯ͕ग़Δલͷ ͜ͱͳͷͰɺͦΕͳΓʹ࣌ؒΛͬͯߴԽ͢Δ Ձ͕͋Δ • ʮؾΛ͚࣮ͭͯ͢Δʯোͷͱ
Slide 29
Slide 29 text
/Ͱ"1*ΞΫηε ͯ͠αʔόʔͷෛՙ্͕ঢ
Slide 30
Slide 30 text
/ • ͋ΔϦιʔεʢͨͱ͑RecipeʣΛNݸऔಘͨ͋͠ ͱɺͦͷϦιʔεʹඥͮ͘ผͷϦιʔεʢͨͱ͑ UserʣΛऔಘ͠Α͏ͱͯ͠͞ΒʹNճͷAPIΛൃߦ ͯ͠͠·͍ύϑΥʔϚϯε͕ྼԽ͢Δ • RailsͰΑ͋͘Δ͜ͱͰɺbulletͱ͍͏N+1Λ ൃݟ͢Δઐ༻ͷgem·Ͱ͋Δ
Slide 31
Slide 31 text
J04ΞϓϦͰ/ʹؾͮ͘ • ίʔυϨϏϡʔQA Λ௨աͯ͠ɺϦϦʔεޙʹAPI αʔόͷෛՙ͕ߴ·ͬͯൃ֮ • αʔόʔαΠυͷ࣮Α͘ͳ͔ͬͨͷͰͦͷվ ળͰ͋Δఔ͠ͷ͛ͨ • ΞϓϦͷڍಈͦͷͷਖ਼ৗ͕ͩো͕͓͖Δͱ͍ ͏ঢ়گͩͬͨ
Slide 32
Slide 32 text
ղܾࡦɿνΣοΫϦετʹ߲ΛՃ • pull-requestʹಛఆͷϥϕϧΛ͚ͭΔͱɺͦΕʹԠ͡ ͨνΣοΫϦετ͕షΒΕΔΈ͕͋Δ • ͦΕΛ֦ுͯ͠νΣοΫͰ͖ΔΑ͏ʹͨ͠ • ߋʹΞϓϦ͔ΒͷϦΫΤετΛΩϟϓνϟͯ͠νΣο Ϋ͢ΔΈΛςετʹΈࠐΜͩ
Slide 33
Slide 33 text
1SP(VBSEͱͷઓ͍
Slide 34
Slide 34 text
1SP(VBSE • JavaͷόΠτίʔυͷͨΊͷminifyπʔϧ • γϯϘϧ໊ͷॖɺόΠτίʔυ࠷దԽɺϝλσʔλͷআɺσο υίʔυআɺಡԽͳͲΛߦ͏ • γϯϘϧ໊ͷॖͱσουίʔυআͰAPKαΠζΛখ͘͢͞Δޮ ՌΛظ • ProGuardͦͷ্༷ɺΞϓϦͷػೳෆશΛඇৗʹى͍͜͢͠ • ͔͠͠APKαΠζͷॖখޮՌϝΨόΠτʹٴͿͷͰΘͳ͍ Θ͚ʹ͍͔ͳ͍
Slide 35
Slide 35 text
BTTVNFOPTJEFF⒎FDUT • σουίʔυআʹ͓͍ͯɺಛఆͷϝιου͕෭࡞ ༻Λ࣋ͨͳ͍ͱ͍͏ώϯτΛ༩͑ΔΦϓγϣϯ • ϩΨʔͷϝιουΛ "no side-effects" ͱ͢Δ͜ͱͰɺ Log.d()ͷݺͼग़͠ΛόΠτίʔυ͔ΒআͰ͖Δ • ΫοΫύουΞϓϦͰ͜ΕͰϩάग़ྗΛ͍ͬͯ ͕ͨ…
Slide 36
Slide 36 text
ϦϦʔεϏϧυͰϩάग़ྗ • ͋Δόʔδϣϯ͔Βϩάग़ྗ͕ແޮԽ͞Εͳ͍ঢ়ଶ ʹͳ͍ͬͯͨ • ͦ͜Ͱ -assumenosideeffects Ͱ Log.d() Λআ͢Δ ͜ͱʹͨ͠ɿ BTTVNFOPTJEFF⒎FDUTa DMBTTBOESPJEVUJM-PH\NFUIPET^
Slide 37
Slide 37 text
"1*αʔόͷෛՙ૿େ • ΄Ͳͳͯ͘͠APIαʔόͷෛՙ͕ߴ·͖ͬͯͨ • ೝূϦΫΤετ͕աʹൃߦ͞Ε͍ͯΔΒ͍͠ • ΫοΫύουΞϓϦىಈ࣌ʹೝূΛߦ͏Α͏ʹͳͬ ͍ͯΔ • ೝূ͕͍ྃͯ͠ͳ͍ͱ͖ʹൃߦ͞Εͨͦͷଞͷ APIίʔϧೝূ͕௨Δ·ͰͭΑ͏ʹͳ͍ͬͯΔ w w
Slide 38
Slide 38 text
"1*ίʔϧೝূ͕௨Δ·Ͱͭ w w • ͜ͷͪ߹Θͤʹ Object#wait() Λ͍ͬͯͨ • -assumenosideeffects class Log { ; } Ϋϥε ֊ΛḪͬͯద༻͞ΕΔ • LogΫϥεͷεʔύʔΫϥεͰ͋ΔObjectΫϥεͷશϝ ιου͕෭࡞༻ͳ͠ͱղऍ͞ΕΔʂ • ͜ͷΑ͏ͳܦҢͰ Object#wait() ͷݺͼग़͕͠όΠτίʔ υ͔Βআ͞Ε͍ͯͨ…
Slide 39
Slide 39 text
ͳͥϦϦʔε·Ͱؾ͔ͳ͔͔ͬͨ • APIίʔϧͷೝূ͕ͪյΕͨ݁Ռɺೝূ͕ͱ͓Βͣʹ APIίʔϧ͕͞ΕͯΤϥʔʹͳ͍ͬͯͨ • ͔͠͠ɺAPIΫϥΠΞϯτʹ࣮͞ΕͨࣗಈϦτϥΠػ ߏ͕͏·͘ಈ͍ͯ͠·͍ɺϦτϥΠ͢Δؒʹೝূ͕ͱ͓ͬ ͯଓ͘APIίʔϧ͕ޭͯ͠͠·͏ • ·ͨΞϓϦͷڍಈͦͷͷਖ਼ৗ͕ͩো͕͓͖Δͱ ͍͏ঢ়گ
Slide 40
Slide 40 text
"1*ݺͼग़͠ଟ͗͢ͷࠜຊղܾ • ΞϓϦ্ͰΦʔόʔϨΠදࣔ͢ΔϩΨʔΛͭ͘Γɺ status 4xx, 5xxͷAPIݺͼग़͠ΛͦͷϩΨʔͰه͢Δ Α͏ʹͨ͠ʢAndroid, σόοάϏϧυͰͷΈ༗ޮʣ • ͦͷޙɺ௨৴पΓͷτϥϒϧΦʔόʔϨΠϩΨʔ ͷ͓͔͛Ͱ͍ͩͿॿ͔ͬͨ • ·ͨ௨৴ྔΛଌఆ͢ΔπʔϧΛͭ͘ΓɺQAʹऔΓೖ Εͨ
Slide 41
Slide 41 text
͓ΘΓ