Slide 1

Slide 1 text

©2018 Wantedly, Inc. Wantedlyʹ͓͚Δ ϓϩμΫτɺٕज़ɺ૊৫ 7೥ؒͷਐԽ Rails Developers Meetup 2018 Day 3 Extreme 13.Jul.2018 - Yoshinori Kawasaki (@kawasy)

Slide 2

Slide 2 text

©2018 Wantedly, Inc. ͖͔͚ͬ https://twitter.com/yoshi_hirano/status/1007042090142871553

Slide 3

Slide 3 text

©2018 Wantedly, Inc. 7೥Λ20෼Ͱ ۦ͚଍Ͱ࿩͠·͢

Slide 4

Slide 4 text

©2018 Wantedly, Inc. Railsͷ࿩͸΄ͱΜͲ͠·ͤΜ

Slide 5

Slide 5 text

©2018 Wantedly, Inc. શମͱͯ͠͸4/4ϓϥοτϑΥʔϜ w ͭͷΞΧ΢ϯτͰɺෳ਺ͷϓϩμΫτɾଟ਺ͷػೳ w ʮ͍͍࢓ࣄΛͯ͠ɺ͍͍ਓੜΛૹΕΔΑ͏ʹ͢Δʯ ϓϩϑΟʔϧͱιʔγϟϧάϥϑ w ͜Ε·Ͱ΍͖ͬͯͨ࢓ࣄɺϓϩδΣΫτɺ͜Ε͔Β΍Γ͍ͨ͜ͱ w ୭ͱͲͷΑ͏ͳϏδωε্ͷͭͳ͕ΓΛ΋͍ͬͯΔ͔ άϥϑͷن໛ w Τοδԯ w ϊʔυઍສ લఏ8BOUFEMZͱ͸

Slide 6

Slide 6 text

©2018 Wantedly, Inc. ݱࡏͷن໛ײ

Slide 7

Slide 7 text

©2018 Wantedly, Inc. ओͳϓϩμΫτ ڊେͳRailsΞϓϦʴα ϚΠΫϩαʔϏε܈

Slide 8

Slide 8 text

©2018 Wantedly, Inc. ຊମΞϓϦ ͷϚΠΫϩαʔϏε

Slide 9

Slide 9 text

©2018 Wantedly, Inc. ຊମΞϓϦ rails stats +----------------------+--------+--------+---------+---------+-----+-------+ | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | +----------------------+--------+--------+---------+---------+-----+-------+ | Controllers | 34499 | 29175 | 504 | 2675 | 5 | 8 | | Helpers | 8262 | 7008 | 1 | 879 | 879 | 5 | | Jobs | 553 | 422 | 25 | 41 | 1 | 8 | | Models | 45537 | 32639 | 634 | 2978 | 4 | 8 | | Mailers | 2327 | 1978 | 38 | 212 | 5 | 7 | | Javascripts | 33895 | 24907 | 685 | 5454 | 7 | 2 | | Libraries | 21526 | 18426 | 119 | 636 | 5 | 26 | | Tasks | 1893 | 1401 | 0 | 12 | 0 | 114 | | Concern specs | 5396 | 4661 | 12 | 39 | 3 | 117 | | Controller specs | 16406 | 13732 | 2 | 23 | 11 | 595 | | Feature specs | 14109 | 11104 | 0 | 66 | 0 | 166 | | Helper specs | 777 | 669 | 1 | 2 | 2 | 332 | | I18n specs | 30 | 25 | 0 | 0 | 0 | 0 | | Job specs | 274 | 243 | 0 | 0 | 0 | 0 | | Lib specs | 4739 | 3948 | 5 | 14 | 2 | 280 | | Mailer specs | 960 | 820 | 2 | 11 | 5 | 72 | | Model specs | 26295 | 21833 | 0 | 24 | 0 | 907 | | Policy specs | 325 | 282 | 0 | 0 | 0 | 0 | | Request specs | 75 | 50 | 0 | 0 | 0 | 0 | | Serializer specs | 73 | 61 | 0 | 0 | 0 | 0 | | Service specs | 8163 | 6812 | 3 | 12 | 4 | 565 | | Validator specs | 53 | 41 | 0 | 0 | 0 | 0 | +----------------------+--------+--------+---------+---------+-----+-------+ | Total | 226167 | 180237 | 2031 | 13078 | 6 | 11 | +----------------------+--------+--------+---------+---------+-----+-------+ Code LOC: 115956 Test LOC: 64281 Code to Test Ratio: 1:0.6

Slide 10

Slide 10 text

©2018 Wantedly, Inc. ্ཱͪ͛ϑΣʔζ

Slide 11

Slide 11 text

©2018 Wantedly, Inc. ༗࢙Ҏલ ૊৫ w ϑϧλΠϜΤϯδχΞਓ ΞʔΩςΫνϟ w ຊମΞϓϦͷJOJUJBMDPNNJU 5VF4FQ w )FSPLV΂ΜΓɻඇΤϯδχΞͰ΋΢ΣϒαʔϏεެ։Ͱ͖Δ

Slide 12

Slide 12 text

©2018 Wantedly, Inc. ༗࢙Ҏલ w ॳظόʔδϣϯΛ౰࣌ΫοΫύουٕज़෦௕ͩͬͨηίϯ͞Μ͕ߴ ଎Խͯ͘͠ΕͨΒ͍͠ɻ࢒೦ͳ͕Βॳظόʔδϣϯ͸िؒͰΫϩʔ ζ

Slide 13

Slide 13 text

©2018 Wantedly, Inc. ਖ਼ࣜϩʔϯν

Slide 14

Slide 14 text

©2018 Wantedly, Inc.

Slide 15

Slide 15 text

©2018 Wantedly, Inc. ਖ਼ࣜϩʔϯν ૊৫ w ϑϧλΠϜΤϯδχΞਓਓ ϓϩμΫτ w ·ͩ·ͩϢʔβͷྲྀೖ΋ఆண΋ͳ͍ɻച্΋θϩ w αʔϏε͕ϢʔβʹՁ஋Λಧ͚͍ͯͳ͍ঢ়ଶ w ͲΕ͚ͩૣ͘มߋͯ͠ɺͲΕ͚ͩࢼߦճ਺Λ૿΍ͤΔ͔ͷউෛ ΞʔΩςΫνϟ w )FSPLV΂ΜΓʂΠϯϑϥ͸Ҿ͖ଓ͖)FSPLVʹ͓·͔ͤ w ৭ؾΛͩͯ͠ɺਓͱձࣾҎ֎ͷϚονϯάػೳΛ։ൃࣦͯ͠ഊ

Slide 16

Slide 16 text

©2018 Wantedly, Inc. ୯݄ࠇࣈԽ ϓϩμΫτ w ϐϘοτΛܦͭͭɺϢʔβɾΫϥΠΞϯτ͕ఆண͠͸͡ΊΔ ΞʔΩςΫνϟ w )FSPLV΂ΜΓʂʂ·ͩ·ͩ)FSPLVʹ͓·͔ͤɻ57์өରԠ΋ίϚϯυҰͭͰ εέʔϧɻ ૊৫ w ͦΕͰ΋ΤϯδχΞϦιʔε͸গͳ͍ w ίΞͷՁ஋ͱͳΔʮ͍͍ग़ձ͍Λ૿΍͢͜ͱʯʹ஫ྗ w ͓ۚΛ෷ͬͯ͘ΕΔΫϥΠΞϯτ͞Μͷ ද໘తͳ ཁ๬͸ࢀߟʹ͢Δ͚ͲɺݴΘ Εͨͱ͓Γʹ͸͠ͳ͍ w Ϣʔβ જࡏస৬ऀ ʹͱͬͯϫΫϫΫ͢Δ৔ॴͰ͋Δ͜ͱΛॏࢹ w ৭ؾΛͩͯ͠ɺ·ͬͨ͘ผͷαʔϏεΛ࡞Ζ͏ͱࣦͯ͠ഊ

Slide 17

Slide 17 text

©2018 Wantedly, Inc. ֦େϑΣʔζ

Slide 18

Slide 18 text

©2018 Wantedly, Inc. ϞόΠϧγϑτ ϓϩμΫτ w ΢Σϒ΋εϚʔτϑΥϯΞΫηε͕૿͖͑ͯͨ w J04"OESPJEΞϓϦͷϦϦʔε ΞʔΩςΫνϟ w ΑΓߴ౓ͳݕࡧମݧͷఏڙͷͨΊ&MBTUJDTFBSDIͷಋೖ w ಈతʹը૾ϦαΠζΛ͢Δը૾഑৴γεςϜͷߏங

Slide 19

Slide 19 text

©2018 Wantedly, Inc. ϞόΠϧγϑτ ΞʔΩςΫνϟ w ϞόΠϧϢʔβ΁ͷମݧ޲্ͱΠϯϑϥͷࣗ༝౓ΛٻΊͯ"84΁ w ౰࣌ͷ)FSPLV͸64&BTUͷΈͩͬͨɻQJOHʹNT w ҰํͰɺ)FSPLVͷΑ͞ɺಛʹܧଓతσϦόϦʔͷ΍Γ΍͢͞ͱόοΫΤϯυ ͷεέʔϥϏϦςΟΛࣦ͍ͨ͘ͳ͍ w l5XFMWF'BDUPS"QQzͷํ๏࿦ʹج͍ͮͨΠϯϑϥߏங w %PDLFSͷຊ൪౤ೖ w ͩΕͰ΋ɺ͍ͭͰ΋ɺͳΜͲͰ΋σϓϩΠՄೳ

Slide 20

Slide 20 text

©2018 Wantedly, Inc. ଟ໘ల։ ϓϩμΫτ w 7JTJU͕ܧଓతͳ੒௕͢ΔҰํͰɺ৽͍͠Ձ஋Λಧ͚Δ͜ͱΛ໛ࡧ w ʮ࿩Λฉ͖ʹߦ͖͍ͨʯϘλϯͷຒΊࠐΈ+4΢ΟδΣοτ w ϏδωεΉ͚νϟοτ 8BOUFEMZ$IBU ΞʔΩςΫνϟ w νϟοτΞϓϦʹͱͬͯʮεϐʔυͱ҆ఆੑ͸ػೳʯ w ෳ਺3BJMTΞϓϦԽͱ'JSFCBTF3FBMUJNF%BUBCBTFͷಋೖ w νϟοτϝοηʔδ༻3BJMTͱϢʔβೝূɾೝՄ3BJMTͷ։ൃ

Slide 21

Slide 21 text

©2018 Wantedly, Inc.

Slide 22

Slide 22 text

©2018 Wantedly, Inc. ଟ໘ల։ ΞʔΩςΫνϟ w ՝୊ w ৽͍͠3BJMTΞϓϦΛ૿΍ͨ͢ΊͷΠϯϑϥλεΫ͕ଟ͍ w σϓϩΠϑϩʔ͕3BJMTಛԽͰଞͷٕज़Λ؆୯ʹ࢖͑ͳ͍ ૊৫ w ϑϧλΠϜΤϯδχΞਓ w ϓϩμΫτ΍ػೳ୯ҐͰɺҰͭͷϛογϣϯΛ΋ͬͨখ͞ͳνʔϜ΁

Slide 23

Slide 23 text

©2018 Wantedly, Inc. ϚΠΫϩαʔϏεԽͷ͸͡·Γ ϓϩμΫτ w 1FPQMFͷ։ൃ։࢝ͱϦϦʔε w ը૾ॲཧɺػցֶशɺฒߦॲཧͳͲ3VCZ͕ಘҙͰͳ͍෼໺΁ͷͱΓ͘Έ͕ඞཁʹ ΞʔΩςΫνϟ w ,VCFSOFUFTͷຊ൪౤ೖɻ"84&$্ʹΫϥελΛߏங w దࡐదॴͳٕज़બఆ͕Մೳʹ w 3VCZ 1ZUIPO (PMBOH /PEFKT $ 3VTU w ҰॠͰ৽͍͠ΞϓϦαʔόΛݐͯΒΕΔੈք w ϞϊϦεͱಉ͙͡Β͍ͷؾܰ͞Ͱػೳ௥Ճ w %PDLFSpMFͱLTͷϚχϑΣετϑΝΠϧΛϨϙδτϦʹ༻ҙ͢Δ͚ͩ w σʔλ෼ੳج൫΋LTΛ׆༻ͯ͠ߏங

Slide 24

Slide 24 text

©2018 Wantedly, Inc. ݱࡏͱࠓޙͷͱΓ͘Έ

Slide 25

Slide 25 text

©2018 Wantedly, Inc. ϚΠΫϩαʔϏεԽͷਐలͱ՝୊ ϓϩμΫτ w 1FPQMFͷ57$.์ө w 7JTJUͷւ֎ల։ʹΑΓάϩʔόϧڌ఺ʹ ΞʔΩςΫνϟ w ʮϚΠΫϩαʔϏεͷπϥϛʹ޲͖߹͏ʯ ૊৫ w ϑϧλΠϜΤϯδχΞਓ

Slide 26

Slide 26 text

©2018 Wantedly, Inc. ϚΠΫϩαʔϏεͷπϥϛʹ޲͖߹͏ w ෼ࢄτϨʔγϯάʹΑΔPCTFSWBCJMJUZͷ࣮ݱ w *TUJPʹΑΔαʔϏεϝογϡಋೖ w άϥϑσʔλϕʔε%HSBQIͷಋೖʹΑΔߴ౓ͳάϥϑσʔλ׆༻ w ܧଓతʹ੒௕ͤ͞ΔػցֶशϓϩμΫτج൫ͷ࣮ݱ w ػցֶशϓϩμΫτ։ൃͷʮϨʔϧʯΛෑ͘ w ڞ௨ϓϩϑΟʔϧσʔλͷऔಘɾมߋɾ఻ൖ w ϓϩμΫτԣஅྖҬͷΦʔφʔγοϓΛ୭͕͔࣋ͭɻ w ʮมԽͷͨΊͷίετʯͷ࠷খԽ

Slide 27

Slide 27 text

©2018 Wantedly, Inc. ϓϩμΫτ؀ڥɾઓུʹԠͯ͡ɺΞʔ ΩςΫνϟΛมԽ͖ͤͯͨ͞ ϢʔβՁ஋Λ૑Γɺૣ͘ಧ͚ΔͨΊ ʹɺٕज़ͱ૊৫Λม͑Δ ͢͜͠ະདྷΛݟਾٕ͑ͨज़త౤ࢿʹ Αͬͯɺ༏ҐੑΛੜΈग़͢ ͓ΘΓʹ