Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
LGTMについて
Search
amacou
June 28, 2016
Programming
6
100k
LGTMについて
社内の新卒研修でコードレビューについての私見を共有しました
amacou
June 28, 2016
Tweet
Share
More Decks by amacou
See All by amacou
MVPのようなものをチームに提案した話
amacou
3
2.4k
Other Decks in Programming
See All in Programming
as(型アサーション)を書く前にできること
marokanatani
9
2.6k
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
290
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Remix on Hono on Cloudflare Workers
yusukebe
1
280
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
160
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
43
13k
Designing the Hi-DPI Web
ddemaree
280
34k
Speed Design
sergeychernyshev
24
610
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
860
YesSQL, Process and Tooling at Scale
rocio
169
14k
Building an army of robots
kneath
302
43k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
What's in a price? How to price your products and services
michaelherold
243
12k
Scaling GitHub
holman
458
140k
Designing for Performance
lara
604
68k
Producing Creativity
orderedlist
PRO
341
39k
Transcript
LGTMʹ͍ͭͯ GMO ϖύϘ @amacou
ࣗݾհ • @amacou • ݩSIer:2~3ಇ͍ͨޙɺؒ;Β;Βͯͨ͠ • 20144݄25ʹGMO ϖύϘೖࣾ • ԬͷminneνʔϜʹଐ
• 20156݄ʹ౦ژͷminneνʔϜʹҠಈ • ͖ͳ৯:মௗͱഅ
LGTM
LGTM • Looks good to meʂ(Αͦ͞͏ʂ) • ࠓճɺ͍͍ͭͬͯΔʮLGTMʯͲ͏ ͍͏ͱ͜Ζ͕ʮΑͦ͞͏ʯͱࢥͬͯॻ͍͍ͯ Δ͔Λ·ͱΊ·͢
ࠓ͢͜ͱ • ίʔυϨϏϡʔͷత • ͳʹΛϨϏϡʔ͢Δͷ͔ • TipsΛ͚ͩ͢͜͠
ͪΖΜݸਓͷݟղΛଟʹؚΜ Ͱ͍·͢
ίʔυϨϏϡʔͱ ίʔυϨϏϡʔʢӳ: Code reviewʣɺιϑ τΣΞ։ൃఔͰݟա͝͞ΕͨޡΓΛݕग़ɾ मਖ਼͢Δ͜ͱΛతͱͯ͠ιʔείʔυͷମܥ తͳݕࠪʢࠪಡʣΛߦ͏࡞ۀͷ͜ͱɻ (ग़య)https://ja.wikipedia.org/wiki/ίʔυϨϏϡʔ
ίʔυϨϏϡʔͱ ίʔυϨϏϡʔʢӳ: Code reviewʣɺιϑ τΣΞ։ൃఔͰݟա͝͞ΕͨޡΓΛݕग़ɾ मਖ਼͢Δ͜ͱΛతͱͯ͠ιʔείʔυͷମܥ తͳݕࠪʢࠪಡʣΛߦ͏࡞ۀͷ͜ͱɻ (ग़య)https://ja.wikipedia.org/wiki/ίʔυϨϏϡʔ
ݟա͝͞ΕͨޡΓ ϓϩάϥϚͷεΩϧʹΑΒͣɺॻ͖ԼΖ͞Ε͔ͨΓͷιʔείʔυજࡏతʹό άηΩϡϦςΟϗʔϧʢॻࣜจࣈྻɺڝ߹ঢ়ଶɺϝϞϦϦʔΫɺόοϑΝΦʔ όʔϥϯͳͲʣͳͲͷෆ۩߹͕ೖΓࠐΜͰ͍Δ͜ͱ͕ଟ͍ɻ ιϑτΣΞ࣭ΛߴΊΔͨΊʹ͜ͷΑ͏ͳෆ۩߹Λআڈ͍ͯ͘͠ඞཁ͕͋Δɻ ͜ͷෆ۩߹Λൃݟ͠मਖ਼͢ΔͨΊͷ1ͭͷํ๏͕ɺιʔείʔυͷࠪಡΛߦ͏͜ ͱɺ͢ͳΘͪίʔυϨϏϡʔͰ͋Δɻ ΦϯϥΠϯͷιϑτΣΞϦϙδτϦʢಗ໊ͷCVSͳͲʣΛ͏ͱɺෳͷݸਓ͕ ڞಉͰίʔυϨϏϡʔΛߦ͏͜ͱ͕Ͱ͖Δɻ ίʔυϨϏϡʔΛࣗಈԽ͢ΔιϑτΣΞΛ͏ͱɺιϑτΣΞ։ൃऀͷΘΓ
ʹయܕతͳηΩϡϦςΟϗʔϧΛݟ͚ͭΔ࡞ۀΛߦͬͯ͘ΕΔɻͦͷΑ͏ͳιϑτ ΣΞͷྫͱͯ͠ɺFlawfinder Rough Auditing Tool for Security(RATS) ͳͲ͕ ͋Δɻ (ग़య)https://ja.wikipedia.org/wiki/ίʔυϨϏϡʔ
ͭ·Γ ΈΜͳͰόάηΩϡϦςΟʔϗʔ ϧΛݟ͚ͭΔ࡞ۀ
ͰຊʹͦΕ͚ͩͳͷ͔ʁʁ
ίʔυϨϏϡʔͷత • Λڞ༗͢Δ • ଐਓԽΛഉআ͢Δ • ίʔυͷ࣭Λ্͛Δ
Λڞ༗͢Δ • ϨϏϡʔ͢Δ͜ͱͦͷίʔυʹରͯ͠ Λ࣋ͭ͜ͱ • ͦͷίʔυʹ͕ͳ͍ͱ͍͏͜ͱͷอূ ਓʹͳΔ • ࣗࣄʹ͢Δ •
ೲಘ͢Δ·Ͱ͠߹͏ඞཁ͕͋Δ
ίʔυϨϏϡʔͷత • Λڞ༗ • ଐਓԽΛഉআ͢Δ • ίʔυͷ࣭Λ্͛Δ
ଐਓԽΛͳ͘͢ • ʮࠓʓʓ͞Μ͕ٳΈ͔ͩΒରԠͰ͖ͳ͍ʯ ʹͳΒͳ͍Α͏ʹ͢Δ • ͩΕͰͯ͢ͷίʔυΛϝϯςͰ͖ΔΑ ͏ʹͳΔ
ίʔυϨϏϡʔͷత • Λڞ༗ • ଐਓԽΛഉআ͢Δ • ίʔυͷ࣭Λ্͛Δ
ίʔυͷ࣭Λ্͛Δ • ίʔυΛཧղͰ͖Δ͔ • ޡΓ(όά)ͳ͍͔ • ϛΫϩͳόά • ϚΫϩͳόά •
ίʔυอकͰ͖Δ͔ • ૉΒ͍͠ίʔυͳ͍͔
ίʔυΛཧղͰ͖Δ͔ • ίʔυΛཧղ͢ΔͨΊʹ͕ࣝඞཁ • ݴޠ • ϑϨʔϜϫʔΫ • ϥΠϒϥϦ •
ΞϧΰϦζϜ • αʔϏε(ϏδωεϩδοΫ) • ࣝͷڞ༗ • ͩΕ͕ཧղͰ͖ΔΑ͏ʹͳΒͳ͍ͱଐਓԽ ͕͢͢Ή
ίʔυΛཧղͰ͖Δ͔ • Ͳ͏ͬͯཧղ͢Δ͔ • ͦͷίʔυͲ͏ͯ͠ඞཁͳͷ͔?Λҙࣝ͠ ͯಡΉ • Θ͔Βͳͯ͘٧·ͬͨΒฉ͘
ίʔυΛཧղͰ͖Δ͔ • Θ͔Βͳͯ͘٧·ͬͨΒฉ͘ • ͜ΕཱͳίʔυϨϏϡʔ • ฉ͔Εͨํɺઆ໌͢Δ͜ͱͰཧղ͕ਂ· Δ • ͓ޓ͍ͷػձͱͳΔ
͍͢͝ΤϯδχΞ͞Μ͕ҙຯΘ͔ Μͳ͍ίʔυॻ͍ͨΒόάͷՄೳ ੑ͕ߴ͍(ؾ͕͢Δ)
·͕ͪͬͯɺ ʰʮ͋ͷਓʯͷ͜ͱ͔ͩΒɺ͜ͷ ίʔυʹࢲͷߟ͕͑ٴͳ͍ਸ ߴͳཧ༝͕͋Δʹҧ͍ͳ͍ʱ ͳͲͲࢥͬͯޱΛ͙ͭ·ͳ͍͜ͱɻ ·ͣฉ͜͏ɻ
ίʔυͷ࣭Λ্͛Δ • ίʔυΛཧղͰ͖Δ͔ • ޡΓ(όά)ͳ͍͔ • ϛΫϩͳόά • ϚΫϩͳόά •
ίʔυอकͰ͖Δ͔ • ૉΒ͍͠ίʔυͳ͍͔
ϛΫϩͳόά • ϧʔϓ • ifͷ݅ • typo͕ͳ͍͔ • ʹͳ͍͔
ϛΫϩͳόά • ඞཁͳ͕ࣝগͳ͘ɺؒҧ͍͕͖ͬΓͱࢦ ఠͰ͖ΔͷͰίετ • linter(੩తίʔυղੳπʔϧ)Ͱػցతʹݟͭ ͚Δ͜ͱ͕Ͱ͖Δ͜ͱଟ͍ • ex) rubocop
ػցʹͰ͖Δ͜ͱͳΔ͘ػ ցʹͬͯΒ͍·͠ΐ͏
ίʔυͷ࣭Λ্͛Δ • ίʔυΛཧղͰ͖Δ͔ • ޡΓ(όά)ͳ͍͔ • ϛΫϩͳόά • ϚΫϩͳόά •
ίʔυอकͰ͖Δ͔ • ૉΒ͍͠ίʔυͳ͍͔
ϚΫϩͳόά • αʔϏεͱͯؒ͠ҧ͍ͬͯͳ͍͔ • ࠓ·Ͱͷ༷ͱໃ६ͳ͍͔ • ฏߦͯ͠࡞͍ͬͯΔଞͷػೳͱͷໃ६ͳ͍ ͔ • ಛఆͷ݅ͷ࣌ʹഁ͠ͳ͍͔
ϚΫϩͳόά • ݟ͚ͭΔͷൺֱత͍͠ • αʔϏεͷ͕ࣝඞཁʹͳΔ • ͔͔࣌ؒΔ͠ߴίετ
αʔϏεʹଐ͞Ε͙ͯ͢ݟͭ ͚Δͷ͍͠
Ͳ͏͢Εݟ͚ͭΒΕΔ͔?
ࣝΛ૿͔͢͠ͳ͍
ଐ͞Ε͙ͯ͢ʹ͜ͷϨϕϧͷ ϨϏϡʔٻΊΒΕͳ͍ͷͰɺয Βͣʹண࣮ʹ͍͜͏
ίʔυͷ࣭Λ্͛Δ • ίʔυΛཧղͰ͖Δ͔ • ޡΓ(όά)ͳ͍͔ • ϛΫϩͳόά • ϚΫϩͳόά •
ίʔυอकͰ͖Δ͔ • ૉΒ͍͠ίʔυͳ͍͔
ίʔυอकͰ͖Δ͔ • ίʔυγϯϓϧ͔ • Մಡੑߴ͍͔ • ςετΓ͍ͯΔ͔
ίʔυγϯϓϧ͔ • ૄ݁߹ͳΫϥεʹͳ͍ͬͯΔ͔ • DRYʹͳ͍ͬͯΔ͔ • ܧঝਂ͗͢ͳ͍͔ • Ϋϥεେ͖͗͢ͳ͍͔ •
ૣ͗͢Δ࠷దԽͳ͍͔
ίʔυอकͰ͖Δ͔ • ίʔυγϯϓϧ͔ • Մಡੑߴ͍͔ • ςετΓ͍ͯΔ͔
Մಡੑߴ͍͔ • ୭ͰಡΊॲཧͷ༰͕Θ͔Δίʔυ͕ඞ ཁ • ࣍୭͕ฤू͢Δ͔Θ͔Βͳ͍ • ͦͦ໌ͷࣗଞਓ
໊͚ • Ϋϥε໊/ϝιου໊/ม໊ͳͲΛదͳ໊ લʹ͢Δ͜ͱ • ՄಡੑΛߴΊΔͨΊʹదͳ໊લ͕ඞཁ • ΊͬͪΌ͍͠ • Αٞ͘ʹͳΔ
ద • దͳ໊લ͕͍͍ͯΔͱॲཧͷৄࡉΛ͏ճ ͕ݮΔ • a1, a2ͱ͍͏ϝιου໊ͱ, delete, nameͱ͍͏ ϝιου໊
• ϝιουʹӕ͕ͳ͍͔Ͳ͏͔ΛΑ͘ߟ͑ͳ͍ͱό άͷԹচʹͳΔ • deleteͰupdateΛ͍ͯͨ͠ͱ͔ɺdeleteͰࣦഊ ͯ͠trueΛฦ͍ͯͨ͠ͱ͔
ίʔυอकͰ͖Δ͔ • ίʔυγϯϓϧ͔ • Մಡੑߴ͍͔ • ςετΓ͍ͯΔ͔
ςετΓ͍ͯΔ͔ • ྫ͑ • rubyͷόʔδϣϯΞοϓ • railsͷόʔδϣϯΞοϓ • େ͖ΊͷػೳͷϦϑΝΫλϦϯά •
࣮֬ʹྑ͘ͳΔͣͳͷʹɺςετ͕ͳ͍ͱාͯ͘Ͱ͖ ͳ͘ͳͬͯ͠·͏ • ͍ͭͷؒʹ͔࠷৽ʹ͍͚ͭͳΔ • ηΩϡϦςΟʔϦεΫ • Ͳ͏ͤͳΒॻ͖ͨ͠΄͏͕͍ͷͰ
ίʔυͷ࣭Λ্͛Δ • ίʔυΛཧղͰ͖Δ͔ • ޡΓ(όά)ͳ͍͔ • ϛΫϩͳόά • ϚΫϩͳόά •
ίʔυอकͰ͖Δ͔ • ૉΒ͍͠ίʔυͳ͍͔
ૉΒ͍͠ίʔυͳ͍͔ • ૉΒ͍͠ίʔυΛݟ͚ͭͨΒੵۃతʹڞ༗ ͠Α͏ • ྑ͍ίʔυΈΜͳͰ๙ΊΑ͏ • ͔࣍ΒΈΜͳͰͦΜͳίʔυΛ͔͚ΔΑ ͏ʹͳΖ͏
ʑͷϨϏϡʔͰؾΛ͚ͭΔ͜ͱ
ϨϏϡʔස • Ͱ͖Δ͚ͩૣ͘ϨϏϡʔ͠Α͏ • ΘΕͳ͍ίʔυ͙͢Δ • ίʔυॻ͍ͨޙ͔ΒΕ͍ͯ͘ • ϨϏϡʔ →
मਖ਼ → ࠶ϨϏϡʔͷαΠΫϧ খ͍͞΄͏͕Φʔόʔϔου͕গͳ͍
ٞʹ٬؍ੑ͕Γͳ͍࣌ • ϝιου໊ͳͲͰAͱBͲ͕ͬͪΘ͔Γ͍͢ ͔அͰ͖ͳ͍͕࣌͋Δ • ୈࡾऀ͕Ͳ͏͍͏அΛ͍ͯ͠Δ͔ΛௐΔ ͱೲಘͰ͖Δ͜ͱ͕ଟ͍ • ex)ݴޠͰͲ͏͍͏نଇͰ໊લΛ͚͍ͭͯ Δ͔?/ϑϨʔϜϫʔΫ?/ϥΠϒϥϦ?
ϨϏϡʔΛॻ͘ͱ͖ • ཧ༝Λॻ͘ • ྫΛग़͢ ͱฦ͍͢͠
ʮ͜ͷॲཧԿ͕͍ͨ͠ͷ?ʯ ↑Ͳ͏͑·͔͢?
ʮ͜ͷॲཧʓʓͱ͍͏͜ͱΛΓ͍ͨΑ͏ʹ ݟ͑ΔͷͰ͕͢ɺͦΕͳΒ☓☓☓ͱ͍͏ॻ͖ํ ʹม͑ͨ΄͏͕γϯϓϧʹͳΓͦ͏Ͱ͢ʯ ↑Ͳ͏͑·͔͢?
࠷ޙʹ
େࣄͳ͜ͱ • αʔϏεΛյ͞ͳ͍͜ͱΛνʔϜͰ୲อ͢Δ • ະདྷʹΘͨͬͯ։ൃΛଓ͚ΒΕΔΑ͏ʹ͢Δ • ͕ࣗͨͪ͢Δ
ͬͱΘ͔Γ͍͢ࢿྉͳ͍ͷ? • ࠓճͷࢿྉΛॻ͖ऴ͑ͯʮ͏ʙΜΘ͔Γʹ͘ ͍ͳ͊ͬͯʯͬͯࢥͬͯάάͬͨΒɺಉ྅͕2 લʹॻ͍ͨࢿྉ͕͋ͬͨɻ • ͥΜͥΜιονͷ΄͏͕Θ͔Γ͍͢Α • https://speakerdeck.com/hisaichi5518/ kodorebiyufalsehua
ϨϏϡʔؔͰ͖ͳεϥΠυ • ͦ͘ίʔυͷ http://www.slideshare.net/ rootmoon/7-37892729 • ϨϏϡʔ͓͡͞Μͷ https:// speakerdeck.com/seri/ turakunaikodorebiyufalseyun-yong
ίʔυϨϏϡʔͯ͠Β͏ଆͷ • http://techlife.cookpad.com/entry/ 2015/03/30/174713