S oftware C raftmanship Z rich How to not suck at Code Reviews ;-) - - PowerPoint PPT Presentation

s oftware c raftmanship z rich
SMART_READER_LITE
LIVE PREVIEW

S oftware C raftmanship Z rich How to not suck at Code Reviews ;-) - - PowerPoint PPT Presentation

S oftware C raftmanship Z rich How to not suck at Code Reviews ;-) Survey time! Code Quality - Happy? Code Reviews @ Job? Commit Review? Pull Review? vs. Code Review? Who is reviewing their own code? Agenda aka The plan 1. Exercise


slide-1
SLIDE 1

Software Craftmanship Zürich

How to not suck at Code Reviews ;-)

slide-2
SLIDE 2

Survey time!

Code Quality - Happy? Code Reviews @ Job? Commit Review? Pull Review? vs. Code Review? Who is reviewing their own code?

slide-3
SLIDE 3

Agenda aka “The plan”

  • 1. Exercise
  • 2. World cafe
  • 3. Tips from videos / blogs

a. 3 “code review” smells

  • 4. Closeup & Action
slide-4
SLIDE 4

Exercise

Groups of 3 2 reviewers, 1 observer Grab some code 15 minutes Timer starts soon...

slide-5
SLIDE 5

Exercise: How was it?

5min Feedback in your group 2 min: Come up with 3 points to share to all

slide-6
SLIDE 6

Exercise: How was it?

Share in the whole group → Only share if something wasn’t said before

slide-7
SLIDE 7

World Cafe

7 rounds x ~4min

slide-8
SLIDE 8

Code Review Tips

From the internetz

from RailsConf 2015 - Implementing a Strong Code-Review Culture https://www.youtube.com/watch?v=PJjmw9TRB7s and lots of blogs …

slide-9
SLIDE 9

Code reviews as a regular thing every day? Who is doing code reviews? Who is enjoying them? Who is doing them because you have to?

slide-10
SLIDE 10

Good code is like a joke!

No need for explanation

slide-11
SLIDE 11

Why do we do Code reviews?

slide-12
SLIDE 12

“Code Reviews make me better every day.“

  • Knowledge transfer
  • Increased team awareness
  • Finding alternative solutions
slide-13
SLIDE 13

The process is more important than the result. Discuss your code with your peers.

slide-14
SLIDE 14

What is a strong Code Review culture?

Everybody involved. Not seniors over juniors. Don’t dismiss feedback, healthy discussion, why this question?

slide-15
SLIDE 15

What is a strong Code Review culture?

There is a negativity bias with written communication. PRs. How do we handle disagreements? What should I be reviewing?

slide-16
SLIDE 16
  • 1. As an author... Provide sufficient

context.

Content is king? Context is God -> Why? What problems are we solving. Commit message. Link to Jira? No. What have you learned? Add 2 paragraphs of context.?

slide-17
SLIDE 17
  • 2. As a reviewer

Ask don't tell. “What do you think…” “Did you consider…” “Can you clarify…”

slide-18
SLIDE 18

How to deal with conflict?

Don’t just agree on the issue:

  • -> Agree to disagree + Commit

Fear of conflict → Commitment Exception? We don’t agree on the process? eg “Commit directly to master”?

slide-19
SLIDE 19

What to review?

Timing:

  • Small changes -> easier to provide context
  • SRP
  • Naming

(2 hard things in CS: Naming, Cache invalidation, timezones)

  • Complexity: shape of change = complex
  • Test coverage

Styleguide: Agree and outsource the tool. A bot tells you

slide-20
SLIDE 20

Refactoring PR

Give context on refactor PR Why this refactoring?

slide-21
SLIDE 21

Strong Code review culture leads to

  • Better code
  • Better developers
  • Team ownership
  • Healthy debate > silent agreement
slide-22
SLIDE 22

Review VS Pairing

A Code Review = async pairing Async advantage → Change stands on its own!! Time zone differences?

slide-23
SLIDE 23

Tools

Tools: Pull Requests + Github, Gitlab TFS code-review Codeclimate, upsource/gerrit, static code analyzers, stylecop/SonarQube/Sputnik

slide-24
SLIDE 24

Review not only code

  • Tests
  • Build process
  • Deployment scripts
  • Configuration
slide-25
SLIDE 25

</ Code Review Tips

slide-26
SLIDE 26

Code Review Smells

slide-27
SLIDE 27

Management follows PRs

slide-28
SLIDE 28

Authors merge own PR

slide-29
SLIDE 29

The tech lead is the gatekeeper

slide-30
SLIDE 30

</ Code Review

Smells

slide-31
SLIDE 31

What else?

#codereview channel on SC Slack https://softwarecraftsmanship.slack.com/messages/code- review/ Invite via http://scslackin-rradczewski.rhcloud.com/

slide-32
SLIDE 32

Feedback door

slide-33
SLIDE 33

Next SCZ session?

Do you want to run a workshop? Do you have a topic? → Get in touch! What about: How to spice up your Code Review?

slide-34
SLIDE 34

What will you do different tomorrow?

Continue the conversation

@peitor @patbaumgartner