How To Do Positive Code Reviews

How To Do Positive Code Reviews

How to create an environment where code reviews are a positive experience for everyone involved.

Presented at PHP Cambridge on Feb 16th 2016.

2c1dc90ff7bf69097a151677624777d2?s=128

Stuart Herbert

February 16, 2016
Tweet

Transcript

  1. 10.

    @GanbaroDigital How Tasks Are Typically Done 1. Developer is assigned

    ticket in JIRA 2. Developer writes code 
 (and maybe some tests) 3. Best mate reviews code if they have the time 4. Developer merges code
  2. 12.

    @GanbaroDigital How Tasks Are Typically Done 1. Developer is assigned

    ticket in JIRA 2. Developer writes code 
 (and maybe some tests) 3. Best mate reviews code if they have the time 4. Developer merges code
  3. 14.

    @GanbaroDigital How Tasks Are Typically Done 1. Developer is assigned

    ticket in JIRA 2. Developer writes code 
 (and maybe some tests) 3. Best mate reviews code if they have the time 4. Developer merges code
  4. 17.

    @GanbaroDigital How Tasks Are Typically Done 1. Developer is assigned

    ticket in JIRA 2. Developer writes code 
 (and maybe some tests) 3. Best mate reviews code if they have the time 4. Developer merges code
  5. 19.

    @GanbaroDigital How Tasks Are Typically Done 1. Developer is assigned

    ticket in JIRA 2. Developer writes code 
 (and maybe some tests) 3. Best mate reviews code if they have the time 4. Developer merges code
  6. 21.

    @GanbaroDigital How Tasks Are Typically Done 1. Developer is assigned

    ticket in JIRA 2. Developer writes code 
 (and maybe some tests) 3. Best mate reviews code if they have the time 4. Developer merges code
  7. 22.

    @GanbaroDigital It is natural to seek out people who are

    more likely to agree with us. Especially in a toxic culture.
  8. 27.

    @GanbaroDigital How Tasks Are Typically Done 1. Developer is assigned

    ticket in JIRA 2. Developer writes code 
 (and maybe some tests) 3. Best mate reviews code if they have the time 4. Developer merges code
  9. 29.

    @GanbaroDigital How Tasks Are Typically Done 1. Developer is assigned

    ticket in JIRA 2. Developer writes code 
 (and maybe some tests) 3. Best mate reviews code if they have the time 4. Developer merges code
  10. 60.

    @GanbaroDigital “Do as I say, not as I do.” How

    many of you have worked for someone like that?
  11. 63.

    @GanbaroDigital Only then do you have the moral right to

    review the work of your colleagues.
  12. 73.

    @GanbaroDigital Guiding Principles 1. The rule of no surprises. 2.

    Everything must stand up to scrutiny. 3. Everyone is entitled to a bad day. 4. Ask, don’t tell (sometimes).
  13. 76.

    @GanbaroDigital 1. Make sure only the right people attend. 2.

    Make sure expectations are known in advance. 3. Discover and correct problems early.
  14. 77.

    @GanbaroDigital Code Review Attendees 1. Person doing the work. 2.

    Their boss - team lead or senior dev. 3. Observers who need to learn.
  15. 78.

    @GanbaroDigital Code Review Attendees 1. Person doing the work. 2.

    Their boss - team lead or senior dev. 3. Observers who need to learn.
  16. 79.

    @GanbaroDigital Code Review Attendees 1. Person doing the work. 2.

    Their boss - team lead or senior dev. 3. Observers who need to learn.
  17. 80.

    @GanbaroDigital Review Thrice, Ship Once 1. Review task and plan

    of attack. 2. Review code. 3. Review & approve code + tests.
  18. 81.

    @GanbaroDigital Review Thrice, Ship Once 1. Review task and plan

    of attack. 2. Review code. 3. Review & approve code + tests.
  19. 82.

    @GanbaroDigital Before Writing Code • Check understanding of the problem.

    • Review proposed solution. • Review proposed test plan. • Give or withhold approval.
  20. 83.

    @GanbaroDigital Review Thrice, Ship Once 1. Review task and plan

    of attack. 2. Review code. 3. Review & approve code + tests.
  21. 84.

    @GanbaroDigital After Writing Code • Review developed solution. • Review

    revised test plan. • Give or withhold approval.
  22. 85.

    @GanbaroDigital Review Thrice, Ship Once 1. Review task and plan

    of attack. 2. Review code. 3. Review & approve code + tests.
  23. 86.

    @GanbaroDigital Before Merging • Repeat test plan execution. • Review

    test plan execution results. • Give or withhold approval.
  24. 89.

    @GanbaroDigital Make everyone 
 involved in a code review 


    accountable for everything that they have approved.
  25. 90.

    @GanbaroDigital Give everyone 
 involved in a code review 


    the right to refuse to sign off the work.
  26. 92.

    @GanbaroDigital Review Thrice, Ship Once 1. Review task and plan

    of attack. 2. Review code. 3. Review & approve code + tests.
  27. 100.

    @GanbaroDigital No process can solve the problem of toxic people

    … … except perhaps the firing process!
  28. 101.

    Would you like to 
 know more? We can help.

    Stuart Herbert ~ @stuherbert Founder @GanbaroDigital