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

先輩から教えてもらったコードレビュー

 先輩から教えてもらったコードレビュー

LT大会にお呼ばれしました。
内容は以前ブログにしたためた「コードレビューするのが怖いと思っていたエンジニアが半年間コードレビューを経験して思った 10 のこと」についてです☺
http://b.hatena.ne.jp/entry/yutokyokutyo.hatenablog.com/entry/20161213/1481590322

Yuto Kondo

March 07, 2017
Tweet

More Decks by Yuto Kondo

Other Decks in Education

Transcript

  1. ۙ౻༟ే(.01FQBCP *OD
    ʲࣾ߹ಉ-5େձʳ(.0ϖύϘɾ+BQBO5BYJɾΦΠγοΫε
    ઌഐ͔Βڭ͑ͯ΋Βͬͨ
    ίʔυϨϏϡʔ
    ۙ౻༟ే(.01FQBCP *OD
    ʲࣾ߹ಉ-5େձʳ(.0ϖύϘɾ+BQBO5BYJɾΦΠγοΫε

    View full-size slide

  2. 磦堄嫵㞷

    View full-size slide

  3. υϯͱݟ͍ͤͨςΩετΛೖΕΔ

    View full-size slide

  4. ZVUPLZPLVUZPIBUFOBCMPHDPNFOUSZ

    View full-size slide

  5. IUUQTXXXTMJEFTIBSFOFUUBLBGVNJPOBLBTT

    View full-size slide

  6. ొ৔ਓ෺঺հ
    ⃂ ߶ഠƑ༵Ḻ

    View full-size slide

  7. ίʔυϨϏϡʔ΍ͬͯΈͳ͍ʁ
    ˞։ൃνʔϜϝϯόʔ

    View full-size slide

  8. ίʔυϨϏϡʔ
    ͳΜͯͰ͖Δ͸ͣͳ͍Α

    View full-size slide

  9. ͩͬͯ
    ίʔυϦʔσΟϯά
    ͢ΒͰ͖ͳ͍ΜͩΑʁ

    View full-size slide

  10. ίʔυϨϏϡʔ͸
    αʔϏεͷίʔυΛख़஌
    ͍ͯ͠Δਓ͡Όͳ͍ͱ
    Ͱ͖ͳ͍Μ͡Όͳ͍͔ͳʁ

    View full-size slide

  11. ࢲୡ͕αϙʔτ͠·͢ʂ
    ˞։ൃνʔϜϝϯόʔ

    View full-size slide

  12. ΍ͬͯΈΔ͔ɻ

    View full-size slide

  13. ͜ͷΑ͏ʹͯ͠
    ๻ͷίʔυϨϏϡʔਓੜ͕
    ελʔτ͠·ͨ͠ɻ

    View full-size slide

  14. ͱ͸͍͑ϨϏϡʔॳ৺ऀΛ
    ์ஔ͓ͯ͘͠Θ͚ʹ͸͍͖·ͤΜɻ

    View full-size slide

  15. ์͓ͬͯ͘ͱ

    View full-size slide

  16. େৎ෉͡Όͳ͍͔ͳɻ
    ଟ෼େৎ෉ͩΖ͏ʂ
    ϙνοͱͳ

    View full-size slide

  17. େৎ෉͡Όͳ͍͔ͳɻ
    ଟ෼େৎ෉ͩΖ͏ʂ
    ා͗͢Δ

    View full-size slide

  18. Ͳ͏΍͔ͬͨʁ

    View full-size slide

  19. Ȃǩǻƺ✣ Ȃǩǻȅ✣

    View full-size slide

  20. Ȃǩǻƺ✣ Ȃǩǻȅ✣
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  21. Ȃǩǻƺ✣ Ȃǩǻȅ✣
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    -(5.

    View full-size slide

  22. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ

    View full-size slide

  23. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ઌഐ͕
    ࣍ड͚

    View full-size slide

  24. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  25. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    -(5.
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  26. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    -(5. -(5.
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  27. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    NBTUFSʹ
    Ϛʔδ͠·͢
    -(5. -(5.

    View full-size slide

  28. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    NBTUFSʹ
    Ϛʔδ͠·͢
    -(5. -(5.
    ϨϏϡΠʔ͕҆৺
    ๻΋҆৺
    αʔϏε΋҆શ

    View full-size slide

  29. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ

    View full-size slide

  30. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  31. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    Μʁͪ͜͜ΐͬͱ
    ͓͔͍͔͠΋
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  32. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    Μʁͪ͜͜ΐͬͱ
    ͓͔͍͔͠΋
    ͔֬ʹͶʂ
    ΋ͬͱ͍͍ॻ͖ํ
    Ͱ͖ͦ͏ʂ

    View full-size slide

  33. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    ๻ͷߟ͑͸
    ਖ਼͔ͬͨ͠Μͩʂ
    ͔֬ʹͶʂ
    ΋ͬͱ͍͍ॻ͖ํ
    Ͱ͖ͦ͏ʂ

    View full-size slide

  34. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    Μʁͪ͜͜ΐͬͱ
    ͓͔͍͔͠΋
    ͔֬ʹͶʂ
    ΋ͬͱ͍͍ॻ͖ํ
    Ͱ͖ͦ͏ʂ
    ࣗ෼͕ҧ࿨ײΛ࣋ͬͨ
    Օॴ͕ਖ਼͍͠ͱ
    ೝࣝͰ͖Δ

    View full-size slide

  35. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ

    View full-size slide

  36. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  37. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    -(5.
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  38. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    -(5.
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    ͍΍͍΍ʂ
    ͕͓͔͍͜͜͠ͱ
    ࢥ͏ͧ͒ʂ

    View full-size slide

  39. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    ͳΔ΄Ͳɻ
    ͦ͏͍͏ߟ͑ํ͕
    ͋ͬͨͷ͔
    ͍΍͍΍ʂ
    ͕͓͔͍͜͜͠ͱ
    ࢥ͏ͧ͒ʂ

    View full-size slide

  40. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    ͍΍͍΍ʂ
    ͕͓͔͍͜͜͠ͱ
    ࢥ͏ͧ͒ʂ
    ͳΔ΄Ͳɻ
    ͦ͏͍ͬͨߟ͑ํ͕
    ͋ͬͨͷ͔
    ࣗ෼ͷதʹଘࡏ͢Δ
    όουύλʔϯʹؾ෇͘
    ͜ͱ͕Ͱ͖Δ

    View full-size slide

  41. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    ͳΔ΄Ͳɻ
    ͦ͏͍͏ߟ͑ํ͕
    ͋ͬͨͷ͔
    ͍΍͍΍ʂ
    ͕͓͔͍͜͜͠ͱ
    ࢥ͏ͧ͒ʂ
    ࣗ෼ʹ͸ͳ͍ࢹ఺΍ߟ͑
    ํΛֶͿ͜ͱ͕Ͱ͖Δ

    View full-size slide

  42. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ

    View full-size slide

  43. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  44. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    -(5.
    ϨϏϡʔ
    ͓Ͷ͠Ό͢

    View full-size slide

  45. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    -(5.
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    ཱ೿ʹ
    ͳͬͨͳ͊☺

    View full-size slide

  46. Ȃǩǻ✣၇内 Ց൳Ŵ Ց൳Ŵ
    ϨϏϡʔ
    ͓Ͷ͠Ό͢
    ͍΍͍΍ʂ
    ͕͓͔͍͜͜͠ͱ
    ࢥ͏ͧ͒ʂ
    ͳΔ΄Ͳɻ
    ͦ͏͍ͬͨߟ͑ํ͕
    ͋ͬͨͷ͔
    ׳Ε͍ͯ͘ʹͭΕͯ
    ҰਓͰϨϏϡʔͰ͖Δ
    ྔ͕૿͍͑ͯ͘

    View full-size slide

  47. ໰୊ʹͿͪ౰ͨΓ·ͨ͠ɻ

    View full-size slide

  48. ҰਓͰίʔυϨϏϡʔΛ
    ͢Δͱ͖ʹࣗ৴͕࣋ͯͳ͍

    View full-size slide

  49. ઌഐୡͷΑ͏ʹత֬ͳ
    ίʔυϨϏϡʔ͕Ͱ͖ͳ͍

    View full-size slide

  50. ͳ͔ͳ͔ಠΓཱͪͰ͖ͳ͍যΓ

    View full-size slide

  51. νʔϜϝϯόʔͱ;Γ͔͑Γ
    ˞։ൃνʔϜϝϯόʔ

    View full-size slide

  52. ˞։ൃνʔϜϝϯόʔ
    ·ͣୈҰʹযΒͳͯ͘େৎ෉ɻ
    Ͱ͖Δ͜ͱ͔Β΍͍ͬͯ͜͏ɻ

    View full-size slide

  53. ˞։ൃνʔϜϝϯόʔ
    ҧ࿨ײΛ࣋ͭ΂͖Օॴ͸ඞͣͰͯ͘Δɻ
    ͦͷՕॴʹ͍ͭͯʮͳͥ͜ͷΑ͏ʹॻ͍ͨͷ
    Ͱ͔͢ʁʯͱ࣭໰͢Δ͚ͩͰ΋ྑ͍ΜͩΑɻ

    View full-size slide

  54. ˞։ൃνʔϜϝϯόʔ
    Կ͔ٙ໰Λ࣋ͬͨͱ͍͏͜ͱ͸΍Γ͍ͨ͜ͱ
    ͕ͦͷίʔυ͔ΒಡΈऔΕͳ͔͔ͬͨΒʂ
    ͦΕ͸͖ͬͱͲ͔͜ʹٞ࿦΍վળͷ༨஍͕͋
    Δͬͯ͜ͱͳΜ͡Όͳ͍͔ͳʁ

    View full-size slide

  55. ˞։ൃνʔϜϝϯόʔ
    ҧ࿨ײΛ࣋ͬͯఏى͚ͨͩ͠ͷίϝϯτ͚ͩ
    Ͱ΋ɺϨϏϡΠʔʹ࠶ߟͤ͞Δ͜ͱͰ৽ͨͳ
    ൃݟ͕ੜ·ΕͨΓ͢Δ͜ͱ΋͋ΔΜͩɻ

    View full-size slide

  56. ˞։ൃνʔϜϝϯόʔ
    (JU)VC্Ͱͷ΍ΓͱΓ͸4MBDLʹ௨஌͞Ε
    ΔΑͶʁͦΕΛݟͨνʔϜϝϯόʔ͔Β·ͨ
    ৽ͨͳίϝϯτΛ໯͑Δ͜ͱͩͬͯ͋Δɻ

    View full-size slide

  57. ˞։ൃνʔϜϝϯόʔ
    ͔ͩΒͦͷҰา͸ઈରʹແବʹͳΒͳ͍ɻ
    ༐ؾΛ࣋ͬͯൃݴ͍ͯ͜͠͏ʂ

    View full-size slide

  58. ͜Μͳࣗ෼Ͱ΋Ͱ͖Δ
    ͔΋͠Εͳ͍ɻ

    View full-size slide

  59. ؾ͕͍ͭͨΒ਺ඦ݅ʹٴͿ
    ίʔυϨϏϡʔΛ͜ͳ͍ͯ͠·ͨ͠ɻ

    View full-size slide

  60. ൒೥ؒΛ;Γ͔͑ͬͯΈͨ

    View full-size slide

  61. ϨϏϡΞʔͷࢹ఺Λ
    ࣋ͭΑ͏ʹͳͬͨ

    View full-size slide

  62. ϨϏϡΞʔͷࢹ఺Λ࣋ͭΑ͏ʹͳͬͨ
    wҙਤ͕͸͖ͬΓ໌ࣔ͞Ε͍ͯΔ΂͖
    wίϛοτͷཻ౓͕ద੾ͰྲྀΕͷ͋Δ΋ͷͱͳ͍ͬͯΔ΂͖
    wಈ࡞ݕূ݁Ռ΍ςετ݁Ռ͕໌ࣔ͞Ε͍ͯΔ΂͖
    wؔ࿈͢ΔJTTVF΍13ͷϦϯΫ͕షΒΕ͍ͯΔ΂͖

    View full-size slide

  63. Πϯσϯτमਖ਼͸
    ਓ͕ؒ΍Δ΂͖Ͱ͸ͳ͍

    View full-size slide

  64. Πϯσϯτमਖ਼͸ਓ͕ؒ΍Δ΂͖Ͱ͸ͳ͍
    wਓ͕ؒ΍Δ΂͖͜ͱͱػց͕΍Δ΂͖͜ͱ͸۠ผ͢Δ΂͖
    wػց͕Ͱ͖Δ͜ͱʹ͍ͭͯ͸ਓ͕ؒ΍ΔΑΓ΋ػցʹ೚ͤͨํ͕਺ඦ
    ഒޮ཰͕ྑ͘ਖ਼֬ͳͷͰੵۃతʹ΍ΒͤΔ΂͖
    wςετͷ࣮ߦ͸$*ʹɺΠϯσϯτͷमਖ਼΍ࢦఠʹ͍ͭͯ͸ݴޠຖʹ
    ͋ΔϦϯτπʔϧΛ࢖͏͜ͱ
    wਓؒ͸ػցʹ͸Ͱ͖ͳ͍ൃ૝΍ߟ͑Δ͜ͱʹ࣌ؒΛඅ΍͢Α͏ʹ͢Δ
    ΂͖

    View full-size slide

  65. ϨϏϡʔ͸औΓࠐΉ΋ͷ

    View full-size slide

  66. ϨϏϡʔ͸औΓࠐΉ΋ͷ
    wຊདྷίʔυϨϏϡʔจԽͷ͋Δ΂͖ਖ਼͖࢟͠͸νʔϜؒͰٞ࿦Λͯ͠
    αʔϏεʹͱͬͯ࠷ऴతʹྑ͍ͱ൑அͨ͜͠ͱΛऔΓࠐΉ͜ͱͰ͋Γɺ
    ΋͠΋मਖ਼͢Δͱ͍͏಺༰ͳͷͰ͋Ε͹ͦΕ͸ϨϏϡΞʔͷҙݟΛऔ
    ΓࠐΉ͜ͱɻ
    wमਖ਼ͱ͍͏ݴ༿͸࢖ΘͣʹϨϏϡʔΛऔΓࠐΉͱ͍͏දݱΛ࢖͏
    Α͏ʹ͍ͯ͠·͢ɻ

    View full-size slide

  67. ϨϏϡʔ͸औΓࠐΉ΋ͷ
    wຊདྷίʔυϨϏϡʔจԽͷ͋Δ΂͖ਖ਼͖࢟͠͸νʔϜؒͰٞ࿦Λͯ͠
    αʔϏεʹͱͬͯ࠷ऴతʹྑ͍ͱ൑அͨ͜͠ͱΛऔΓࠐΉ͜ͱͰ͋Γɺ
    ΋͠΋मਖ਼͢Δͱ͍͏಺༰ͳͷͰ͋Ε͹ͦΕ͸ϨϏϡΞʔͷҙݟΛऔ
    ΓࠐΉ͜ͱɻ
    wमਖ਼ͱ͍͏ݴ༿͸࢖ΘͣʹϨϏϡʔΛऔΓࠐΉͱ͍͏දݱΛ࢖͏
    Α͏ʹ͍ͯ͠·͢ɻ

    View full-size slide

  68. ίʔυϨϏϡʔͱ͸ʁ
    ໰୊WTࢲୡ

    View full-size slide

  69. ίʔυϨϏϡʔͱ͸ʁ
    wʮ໰୊WTࢲୡʯͱ͍͏ߏਤΛৗʹ๨Εͣɺ࠷ྑͷίʔυΛνʔϜͰߟ
    ͑ಋ͖ग़͠࢒͢͜ͱɻ
    wνʔϜͰ࠷ྑͷίʔυΛ࢒͢ͱ͍͏໨తΛ๨Εͳ͚Ε͹ɺͲΜͳϨ
    Ϗϡʔίϝϯτ΋ʮ࠷ྑͷίʔυΛ࢒ͨ͢ΊʹԕྀͤͣʹҙݟΛड़΂
    ͯ͘Ε͍ͯΔʯͱߟ͑Δ͜ͱͰ͖Δɻ
    wϨϏϡΠʔͱϨϏϡΞʔͷ૒ํ͕ޓ͍ʹ໨తΛҰகͤ͞ԕྀͤͣʹา
    ΈدΔ͜ͱͰ࠷ߴͷίʔυϨϏϡʔ͕Ͱ͖Δɻ

    View full-size slide

  70. ֆจࣈɾإจࣈɾײ୰ූ
    ΛదࡐదॴͰ࢖͏

    View full-size slide

  71. ྑͦ͞͏ͳྫ
    w߹ཧతނʹগ͠ݫ͠Ίͳίϝϯτͱͳͬͯ͠·͍ͬͯͯ΋ɺ຤ඌʹস
    إͷإจࣈ΍ײ୰ූ͕͋Δ͚ͩͰ҆৺ΛಘΔ͜ͱ͕Ͱ͖Δͱ৴ͯ͡·
    ͢ɻ

    View full-size slide

  72. ѱ͍ྫ
    wจ຺ͱશؔ͘܎ͷͳ͍ֆจࣈͷ࢖༻͸Φεεϝ͠·ͤΜɻ
    wͳͥͳΒɺ૬खʹҙຯෆ໌ͳֆจࣈΛ࢖ͬͨཧ༝Λߟ͑ͤͯ͞͠·͏
    ͨΊͰ͢ɻ

    View full-size slide

  73. ࿦ཧºײ৘༏উ

    View full-size slide

  74. εΩϧ ढจ
    ίʔυϨϏϡʔ ϝϥκʔϚ
    ίʔυϥΠςΟϯά ϝϥϛ
    ίʔυϦʔσΟϯά ϝϥ
    शಘ
    ೉қ౓

    View full-size slide

  75. εΩϧ ढจ
    ίʔυϨϏϡʔ ϝϥκʔϚ
    ίʔυϥΠςΟϯά ϝϥϛ
    ίʔυϦʔσΟϯά ϝϥ
    शಘ
    ೉қ౓

    View full-size slide

  76. ίʔυϨϏϡʔ΍
    ίʔυϦʔσΟϯά͸
    ֶशͷஈ֊෇͚͕ॎʹͳ͍ͬͯͳ͍

    View full-size slide

  77. ΤϯδχΞͱͯ͠ͷࢹ໺

    View full-size slide

  78. ΤϯδχΞͱͯ͠ͷࢹ໺

    View full-size slide

  79. ΤϯδχΞͱͯ͠ͷࢹ໺

    View full-size slide

  80. ΤϯδχΞͱͯ͠ͷࢹ໺
    ઌഐୡ͕ॻ͘៉ྷͰચ࿅͞Εͨ
    ͓खຊͱͳΔίʔυΛ
    ϨϏϡΞʔͱͯ͠Կ౓΋ݟΔ͜ͱ͕Ͱ͖ͨ

    View full-size slide

  81. ΤϯδχΞͱͯ͠ͷࢹ໺
    ίʔυϨϏϡʔΛ͢Δ͜ͱͰ
    ϘτϧωοΫͱͳ͍ͬͯͨ
    ϦʔσΟϯάɾϥΠςΟϯάɾઃܭྗɾςετ
    ͷجૅతͳྗ͕ߴ଎Ͱ਎ʹ͍ͭͨ

    View full-size slide

  82. ΤϯδχΞͱͯ͠ͷࢹ໺
    ίʔυϨϏϡʔΛ௨ͯ͠νʔϜͷΤϯδχΞͱ
    ڞʹϓϩμΫτΛ଄Γ্͛ͳ͕Β࣮ઓͰಘΒΕ
    Δ஌ݟ͸୅͕͍͑ͨ΋ͷ͕͋Δ

    View full-size slide

  83. ͔ͭͯͷ๻ͷΑ͏ʹ
    ίʔυϨϏϡʔͷҰาΛ
    ౿Έग़ͤͣʹ͍Δ͋ͳͨʂ

    View full-size slide

  84. νʔϜͷதʹίʔυϨϏϡʔΛ
    ͍ͯ͠ͳ͍ະ੒ख़ͷΤϯδχΞ
    ͞Μ͕͍Δ͋ͳͨʂ

    View full-size slide

  85. ੋඇ͜ͷػձʹίʔυϨϏϡʔΛ
    ࢝ΊΔɾ༠ͬͯ͋͛Δ
    ͷ͸͍͔͕Ͱ͠ΐ͏͔ʂ✨

    View full-size slide

  86. ΦϑΟεͷݟֶʹདྷ·ͤΜ͔ʁ
    ڵຯ͋Δํ͓੠͕͚͍ͩ͘͞☺
    ࠷৽ͷ࠾༻৘ใΛνΣοΫˠ !QC@SFDSVJU

    View full-size slide