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

Decoding Code Review - Elixir Conf US

Elaine Naomi
September 07, 2023

Decoding Code Review - Elixir Conf US

Lightning Talk

Elaine Naomi

September 07, 2023
Tweet

More Decks by Elaine Naomi

Other Decks in Programming

Transcript

  1. DECODING
    CODE
    REVIEW
    ElixirConf US - 2023

    View Slide

  2. ELAINE NAOMI WATANABE
    B.Sc. in Computer Engineering
    M.Sc. in Computer Science
    Senior Software Engineer @ TheRealReal
    twitter.com/elaine_nw
    speakerdeck.com/elainenaomi
    linkedin.com/in/elainenaomi
    slides

    View Slide

  3. View Slide

  4. CODE REVIEW

    View Slide

  5. 2001

    View Slide

  6. 60% of defects can be identified
    in code review process
    Boehm, Barry, and Victor R. Basili. "Top 10 list [software development]."
    Computer 34.1 (2001): 135-137

    View Slide

  7. 2009

    View Slide

  8. Code review is a valuable tool for identifying code
    evolvability-related defects that are not detectable
    during the testing phase
    Mäntylä, Mika V., and Casper Lassenius. "What types of defects are really discovered in code
    reviews?." IEEE Transactions on Software Engineering 35.3 (2009): 430-448

    View Slide

  9. http://agilemodeling.com/essays/modelReviews.htm
    Dev.
    Cost of Change
    Time
    Requirements
    Analysis and
    Design
    Review Tests Production

    View Slide

  10. http://agilemodeling.com/essays/modelReviews.htm
    Dev.
    Cost of Change
    Time
    Requirements
    Analysis and
    Design
    Review Tests Production

    View Slide

  11. As an Author

    View Slide

  12. Self-descriptive title
    Motivation (Business Context)
    List previous questions and discussions
    GIFs, screenshots from the changes

    View Slide

  13. Coherent commit messages
    Complete, tested code
    Small changes
    Single responsibility principle

    View Slide

  14. Review your own PR
    Tag people as reviewers
    Apply necessary changes
    Respond to all comments

    View Slide

  15. RubyConf 2018 - A Branch in Time
    https://www.youtube.com/watch?v=8OOTVxKDwe0
    capture the why,
    not the what

    View Slide

  16. As a Reviewer

    View Slide

  17. Identify defects (bugs)
    Suggest alternatives, refactorings
    Reinforce patterns
    Validate functionality (code + business)

    View Slide

  18. Identify security issues
    Analyze performance impact
    Suggest documentation
    Validate the code quality

    View Slide

  19. Be introduced to new functionalities
    Learn new technologies
    Share knowledge and questions

    View Slide

  20. #

    View Slide

  21. Feedback is about the source code,
    not about people

    View Slide

  22. Promote the participation of
    everyone in your team

    View Slide

  23. View Slide

  24. Toxic behaviors in code review
    may not be so obvious…

    View Slide

  25. Toxic behaviors in code review
    may not be so obvious…
    ask feedback

    View Slide

  26. Toxic behaviors in code review
    may not be so obvious…
    read about
    Non-Violent Communication

    View Slide

  27. "This PR should not be merged"
    Opinion-based comment, lacking concrete action, imperative

    View Slide

  28. "Why haven't you created a new module?"
    A question with a judgmental tone
    "Why didn't you think of that?"

    View Slide

  29. Code reviews like a Human
    https://mtlynch.io/human-code-reviews-1/
    https://mtlynch.io/human-code-reviews-2/

    View Slide

  30. it's about adding comments in
    a more constructive manner

    View Slide

  31. "Why haven't you created a new module?"
    A question with a judgmental tone
    "Why didn't you think of that?"

    View Slide

  32. constructive manner
    "What do you think about extracting this
    logic into a module? I think it will
    improve readability and reduce
    complexity"

    View Slide

  33. no assumptions, just a suggestion
    "I don't know if you've already considered
    this, but wouldn't it be worth creating a
    new module for this case?"

    View Slide

  34. Be mindful about unconscious bias

    View Slide

  35. For example,
    about seniority bias

    View Slide

  36. Don't assume that a junior engineer
    needs explanation for everything

    View Slide

  37. And also, about gender bias

    View Slide

  38. Please, don't try to explain what Elixir is
    to a female Elixir engineer

    View Slide

  39. Pay attention for not assuming a female
    Elixir engineer is a junior engineer

    View Slide

  40. #

    View Slide

  41. View Slide

  42. View Slide

  43. https://sourcelevel.io/code-review-ebook

    View Slide

  44. View Slide

  45. View Slide

  46. google.github.io/eng-practices/review/reviewer/standard.html

    View Slide

  47. View Slide

  48. railsgirls.com.br

    View Slide

  49. View Slide

  50. CARNIVAL EDITION

    View Slide

  51. speakerdeck.com/elainenaomi
    elainenaomi.dev
    Muito
    obrigada
    illustrations from undraw.co
    translation: thank you so much!
    slides

    View Slide