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

May the Code Review be with you [English]

Egor Tolstoy
September 22, 2017

May the Code Review be with you [English]

Code review is often mistaken for a silver bullet that solves all the developer problems. In reality it's not exactly like that, and this process has its requirements and constraints, just like everything else. We'll talk about what teams can benefit from code review and how to approach this process. We'll get into the details of process, measure the time it takes and learn to assess its usefulness.

Also the main rules of conducting a code review will be shown: both technical and ethical ones that can have positive impact not only on product quality but also on the team making it.

Egor Tolstoy

September 22, 2017
Tweet

More Decks by Egor Tolstoy

Other Decks in Technology

Transcript

  1. Egor Tolstoy
    telegram.me/
    twitter.com/
    etolstoy
    igrekde

    View Slide

  2. 2

    View Slide

  3. 3

    View Slide

  4. 4

    View Slide

  5. 5

    View Slide

  6. 6

    View Slide

  7. 7
    May the Code Review
    be with you

    View Slide

  8. 8
    Goals
    Practices
    Ethics
    Code
    Review

    View Slide

  9. 9
    Goals
    Practices
    Ethics
    Code
    Review

    View Slide

  10. 10
    Knowledge Sharing
    in a Team

    View Slide

  11. 11

    View Slide

  12. 12

    View Slide

  13. 13

    View Slide

  14. 14

    View Slide

  15. 15
    Shared Code Ownership

    View Slide

  16. 16
    Code reuse

    View Slide

  17. 17
    Error Diagnosis

    View Slide

  18. 18
    Project Consistency

    View Slide

  19. 19
    #1: Shared Code Ownership
    #2: Code reuse
    #3: Knowledge sharing in a team
    #4: Error diagnosis
    #5: Project consistency

    View Slide

  20. 20
    Goal-Question-Metric
    1. Identify the goal
    2. List the questions
    3. Determine the metrics

    View Slide

  21. 21
    Goal
    «Increase code reuse»

    View Slide

  22. 22
    Questions
    Are we using shared libraries in the code?
    Did we extract all visual styles?
    What is a level of code duplication?

    View Slide

  23. 23
    Metrics
    Number of shared libraries
    Number of hardcoded styles
    Level of code duplication

    View Slide

  24. 24
    The plan is completed by 60%

    View Slide

  25. 25
    Goals
    Practices
    Ethics
    Code
    Review

    View Slide

  26. 26
    Who conducts a review?
    When to conduct a review?
    How to conduct a review?

    View Slide

  27. 27
    Who conducts a review?
    When to conduct a review?
    How to conduct a review?

    View Slide

  28. 28
    Small team
    Several independent teams
    Large team
    Single developer

    View Slide

  29. 29

    View Slide

  30. 30
    Author
    Reviewer 1
    Reviewer 2
    Reviewer 3
    Review

    View Slide

  31. Author
    Reviewer 1
    Reviewer 2
    Reviewer 3
    Review

    View Slide

  32. 32

    View Slide

  33. 33
    Team Lead
    Team 1 Team 2

    View Slide

  34. Team Lead
    Team 1 Team 2

    View Slide

  35. 35
    Team Lead
    Team 1 Team 2

    View Slide

  36. 36
    Team Lead
    Team 1 Team 2

    View Slide

  37. 37

    View Slide

  38. 38
    Author

    View Slide

  39. 39
    Author

    View Slide

  40. Author

    View Slide

  41. 41

    View Slide

  42. 42
    Slack Community
    Peer Lab
    Other colleagues

    View Slide

  43. 43
    Who conducts a review?
    When to conduct a review?
    How to conduct a review?

    View Slide

  44. 44

    View Slide

  45. View Slide

  46. 46
    Who conducts a review?
    When to conduct a review?
    How to conduct a review?

    View Slide

  47. 47

    View Slide

  48. 48
    Conduct
    architecture
    reviews

    View Slide

  49. 49
    0
    50
    100
    150
    200
    0 500 1000 1500 2000

    View Slide

  50. lines of
    code
    0
    50
    100
    150
    200
    0 500 1000 1500 2000
    comments
    the more
    lines of code,
    the fewer
    comments

    View Slide

  51. 51
    Conduct self
    assessment

    View Slide

  52. 52
    Always fill review
    description

    View Slide

  53. 53
    Use check lists
    and automate
    them

    View Slide

  54. 54
    SwiftLint
    OCLint
    Infer
    Clang Analyzer
    Copy-Paste Detector

    View Slide

  55. 55
    Code review check list
    automation

    View Slide

  56. 56
    Commit messages style
    Commit content
    Commit messages spelling
    Linters
    Artifacts

    View Slide

  57. 57

    View Slide

  58. 58

    View Slide

  59. 59
    Use code review
    tools

    View Slide

  60. 60
    Upsource / JetBrains
    Crucible / Atlassian
    GitHub

    View Slide

  61. 61

    View Slide

  62. 62

    View Slide

  63. 63
    Opens review in AppCode
    GitHub integration
    Powerful statistics
    Code Ownership
    Flexible notifications

    View Slide

  64. 64
    Pre-commit review
    Snippet review
    Time spent for review
    Atlassian products integrations
    Flexible tags

    View Slide

  65. 65
    Emoji reactions
    Powerful code ownership
    PR templates
    Lots of integrations
    Easy to setup

    View Slide

  66. 66

    View Slide

  67. 67
    Goals
    Practices
    Ethics
    Code
    Review

    View Slide

  68. 68
    Control your
    temper

    View Slide

  69. 69
    Ask questions
    instead of making
    assumptions

    View Slide

  70. 70
    Praise your
    teammates

    View Slide

  71. 71
    Keep short and to
    the point

    View Slide

  72. 72
    Criticise code
    not people

    View Slide

  73. 73
    Learn to admit
    mistakes

    View Slide

  74. 74
    Don't leave any
    comments
    unanswered

    View Slide

  75. 75
    Avoid phrases with
    "my" or "yours"

    View Slide

  76. 76

    View Slide

  77. 77

    View Slide

  78. 78
    Goals&Metrics

    View Slide

  79. 79
    Goals&Metrics
    Team Organization

    View Slide

  80. 80
    Goals&Metrics
    Team Organization
    Engineering Practices

    View Slide

  81. 81
    Goals&Metrics
    Team Organization
    Engineering Practices
    Empathy

    View Slide

  82. You and your team
    need code review
    twitter.com/igrekde

    View Slide