SlideShare a Scribd company logo
1 of 128
Download to read offline
Amanda Sopkin
@amandasopkin amsopkin@gmail.com #devsum18
Code Reviews
Don’t forget to evaluate
this session in the DevSum app!
@amandasopkin
Where are we headed?
Code review
“A systematic examination of
computer code...intended to find
mistakes overlooked in software
development.”
Code reviews:
Many different flavors
Improve us as developers
Why do code reviews?
Improve us as developers
Decentralize knowledge overall
Why do code reviews?
Improve us as developers
Decentralize knowledge
Share responsibility
Why do code reviews?
Improve us as developers
Decentralize knowledge
Share responsibility
Improve code base quality
Why do code reviews?
Why do code reviews?
Improve us as developers
Decentralize knowledge
Share responsibility
Improve code base quality
Knowledge spreading
Costs of a mistake
times less at code review
10 100to
“The first code review”
@amandasopkin
Should I know
this?
“The first code review”
Despicable
Idiot
Outrageous
WTF
@amandasopkin
Code Review Unit TestingIntegration Testing
Levels of defense
Levels of defense
55%
Code Review Unit TestingIntegration Testing
Levels of defense
45% 30%
@amandasopkin
Race conditions
Memory leaks
Threading issues
Misunderstandings/assumptions
Security problems
What do code reviews catch?
What do code reviews catch?
Lightweight vs. Formal
Code Reviews
Fagan inspection
Author (Coder) wrote the code
Reader
Reviewers
Moderator
Fagan inspection
Author (Coder)
Reader paraphrases the task
Reviewers
Moderator
Fagan inspection
Author (Coder)
Reader
Reviewers review the code
Moderator
Fagan inspection
Author (Coder)
Reader
Reviewers
Moderator inspection/coaching
Fagan inspection
Lightweight vs. formal
Over-the-shoulder
Email pass-around
Pair programming
Tool assisted
Lightweight code review
Over-the-shoulder
Email pass-around
Pair programming
Tool assisted
Lightweight code review
Over-the-shoulder
Email pass-around
Pair programming
Tool assisted
Lightweight code reviewLightweight
Over-the-shoulder
Email pass-around
Pair programming
Tool assisted
Lightweight code review
Atlassian Crucible Atlassian's code review tool
Google Gerrit Open source git code review tool
Github Git hosting and pioneer of the "Pull Request"
Facebook Phabricator Open source git/mercurial/svn review tool
Review Board Open source review tool that is SCM/platform neutral
JetBrains Upsource git/mercurial/perforce/svn review tool
Visual Studio Team Services collaborative environment with git
Code review tools
Code review tools: VSTS
Automated code review tools
Automated code review tools
Automated code review tools
Importance of human code review
“Code Review is the single greatest way of
noticing and killing bugs, increasing overall
understanding, fixing design problems, and
learning from one another.”
-Graydon Hoare
1. Functional
2. Clean and maintainable
3. Optimized
Stages of Code Review
Hotbeds of bad feelings
Hotbeds of bad dynamics
anger
jealousy
mistrust
confusion
sad
insecurity
shamefear
annoyed
@amandasopkin
5 Dysfunctions of a Team
Absence of trust
Fear of conflict
Lack of commitment
Avoidance of accountability
Inattention to results
Absence of trust
Fear of conflict
Lack of commitment
Avoidance of accountability
Inattention to results
Absence of trust
Fear of conflict
Lack of commitment
Avoidance of accountability
Inattention to results
Absence of trust
Fear of conflict
Lack of commitment
Avoidance of accountability
Inattention to results
Absence of trust
Fear of conflict
Lack of commitment
Avoidance of accountability
Inattention to results
Code Review example
feature/my-work:
“Fixing a bug in our zoombinator”
@amandasopkin
“This isn’t necessary.
The zoombinator has this
functionality built in.”
?
“The zoombinator is
throwing a zoom
exception and I thought
this would fix the issue. I
can take another look if
you think that would be
better.”
“It shouldn’t throw that
exception. Are you sure
you tested it correctly?”
“I think your solution is good, but I don’t want to butt in,
so I won’t say anything.”
?
@amandasopkin
Dysfunctions at play in our
situation
Mistrust
Fear of Conflict
and
Lack of Commitment
Avoidance of Accountability
Inattention to Results
5 Counters for the
5 Dysfunctions of a Team
Absence of trust
Fear of conflict
Lack of commitment
Avoidance of accountability
Inattention to results
Absence of Trust -> Build Trust
Fear of Conflict -> Be Honest and Open
Lack of Commitment -> Work as a Team
Avoidance of Accountability -> Be Accountable
Inattention to Results -> Tune in
General strategy:
Be empathetic
Be empathetic (Project Aristotle)
People were skilled at reading emotions based on nonverbal cues.
If a team member appeared uneasy with a decision, it was likely
noticed and discussed. If someone appeared down, others
showed concern and support. Those conversations are not always
easy, but they’re important. They allow us to be authentic and
engaged.
Be Empathetic AND Be Honest
Absence of Trust
Build Trust
Avoid assumptions
Share experiences
Follow through
Build Trust
Avoid assumptions
Share your experiences with others
Follow through
@amandasopkin
Fear conflict
Be Honest and Open
Speak like you like each other
Speak like you like each other
Make the other person feel safe
The focus is NOT “being right”
Say “What was the reasoning here...” instead of “why”
There is usually more than one
way
Ask questions, not statements
Speak like you like each other
There is usually more than one way to do it
Ask questions, not statements
Be Honest and Open
@amandasopkin
Fear of Commitment
Work as a Team
Explain things in the review
I am changing this API because
of a bug we discovered in XYZ
steps.
After one hour, take a break
Do it thoroughly, or not at all!
Initial comments Discussion Resolution Approval
Work as a Team
Explain things in the review
After one hour, stop and take a break
Do it thoroughly or not at all
@amandasopkin
Avoidance of Accountability
Be Accountable
Break things up
Communicate early and often
Go face to face when necessary
Break things up in the review
Communicate with others early and often
Go face to face when necessary
Be accountable
@amandasopkin
Inattention to Results
Tune in to the Team
Set a tone for the whole team
Establish guidelines/goals
Adheres to CodeStyle
Proper object oriented design
Sufficient test coverage
Proper naming conventions
Consider a checklist
Set a tone for the whole team
Establish guidelines/goals
Consider a checklist
Tune in to the team
@amandasopkin
General strategy:
Be empathetic
Back to our earlier
situation...
feature/my-work:
“Fixing a bug in our zoombinator”
Inattention to Results
Tune in to the Team
feature/my-work:
“Fixing a bug in our zoombinator to
prevent zoomification by sanitizing the
request.”
“This isn’t necessary.
The zoombinator has this
functionality built in.”
Fear of Conflict
Be Honest and Open
“Did you consider that the
Zoombie class allows us
to filter bad requests?”
?
“The zoombinator is
throwing a zoom
exception and I thought
this would fix the issue. I
can take another look if
you think that would be
better.”
Lack of Commitment
Work as a Team
?“The zoombinator is
throwing a zoom
exception. I think this will
fix the issue because it
won’t be caught at
Zoomification.”
“It shouldn’t throw that
exception. Are you sure
you tested it correctly?”
Absence of Trust
Build Trust
“Could you show me how
this exception occurred?”
“Ok sounds good. Thanks
for walking me through
it.”
“I think your solution is good, but I don’t want to butt in,
so I won’t say anything.”
Avoidance of Accountability
Be Accountable
“I think this is the right strategy because we noticed the
bug is not getting past the Zoomifier.”
Inattention to Results
Inattention to Results
Tune in to the Team
Inattention to Results
?
Conclusion
Empathy is Essential
@amandasopkin
@amandasopkin
Something to say?
@amandasopkin
Thank you!
@amandasopkin
And….
Last but not least
– don’t forget to evaluate this
session in the DevSum app!
@amandasopkin
Something to say?
@amandasopkin
● Icons taken from flaticon.com
● “The 5 Dysfunctions of a Team” by Patrick Lencioni
● “Code Complete” by Steve McConnell
● “Best Kept Secrets of Peer Code Review” by Jason Cohen
● The New York Times
● Medium
Sources
More Examples
“Why are you using the Z class?”
“Could you clean up this validation
provider?”
“Could you clean up this validation
provider?”
Absence of trust
Fear of conflict
Lack of commitment
Avoidance of accountability
Inattention to results

More Related Content

Similar to Code Reviews: the Good, the Bad, and the Ugly

Increasing code quality with code reviews (poetry version)
Increasing code quality with code reviews (poetry version)Increasing code quality with code reviews (poetry version)
Increasing code quality with code reviews (poetry version)
David Stockton
 

Similar to Code Reviews: the Good, the Bad, and the Ugly (20)

2016 letter to Amazon shareholders
2016 letter to Amazon shareholders2016 letter to Amazon shareholders
2016 letter to Amazon shareholders
 
Amazon Jeff Bezos 2016 letter to shareholders
Amazon Jeff Bezos 2016 letter to shareholdersAmazon Jeff Bezos 2016 letter to shareholders
Amazon Jeff Bezos 2016 letter to shareholders
 
Jeff Bezos' 2016 Letter to Amazon Shareholders
Jeff Bezos' 2016 Letter to Amazon ShareholdersJeff Bezos' 2016 Letter to Amazon Shareholders
Jeff Bezos' 2016 Letter to Amazon Shareholders
 
BrightonSEO: How to generate 8 million SEO test ideas - Will Critchlow
BrightonSEO: How to generate 8 million SEO test ideas - Will CritchlowBrightonSEO: How to generate 8 million SEO test ideas - Will Critchlow
BrightonSEO: How to generate 8 million SEO test ideas - Will Critchlow
 
Get Kudos from customers (without bribing them)
Get Kudos from customers (without bribing them)Get Kudos from customers (without bribing them)
Get Kudos from customers (without bribing them)
 
The Care and Keeping of Your Junior Developer
The Care and Keeping of Your Junior DeveloperThe Care and Keeping of Your Junior Developer
The Care and Keeping of Your Junior Developer
 
Design without critique is like a flower without water (WebExpo 2013 version)
Design without critique is like a flower without water (WebExpo 2013 version)Design without critique is like a flower without water (WebExpo 2013 version)
Design without critique is like a flower without water (WebExpo 2013 version)
 
Think epic be epic
Think epic be epicThink epic be epic
Think epic be epic
 
QA is Broken, Fix it!
QA is Broken, Fix it!QA is Broken, Fix it!
QA is Broken, Fix it!
 
The gordian knot
The gordian knotThe gordian knot
The gordian knot
 
Critique and The Design Process: Facilitating Better Feedback
Critique and The Design Process: Facilitating Better FeedbackCritique and The Design Process: Facilitating Better Feedback
Critique and The Design Process: Facilitating Better Feedback
 
Code review guidelines
Code review guidelinesCode review guidelines
Code review guidelines
 
How Leaders Create Accountability Webinar
How Leaders Create Accountability WebinarHow Leaders Create Accountability Webinar
How Leaders Create Accountability Webinar
 
Pairing w developers_stpconpics
Pairing w developers_stpconpicsPairing w developers_stpconpics
Pairing w developers_stpconpics
 
Level Up Your Python Code Reviews to Ship It Faster - WWCodeDigital - 2020
Level Up Your Python Code Reviews to Ship It Faster - WWCodeDigital - 2020Level Up Your Python Code Reviews to Ship It Faster - WWCodeDigital - 2020
Level Up Your Python Code Reviews to Ship It Faster - WWCodeDigital - 2020
 
Communication- Difficult conversations.ppt
Communication- Difficult conversations.pptCommunication- Difficult conversations.ppt
Communication- Difficult conversations.ppt
 
SearchLove San Diego 2017 | Joel Klettke | Don't Buy Your Customer a Beer: Ho...
SearchLove San Diego 2017 | Joel Klettke | Don't Buy Your Customer a Beer: Ho...SearchLove San Diego 2017 | Joel Klettke | Don't Buy Your Customer a Beer: Ho...
SearchLove San Diego 2017 | Joel Klettke | Don't Buy Your Customer a Beer: Ho...
 
Increasing code quality with code reviews (poetry version)
Increasing code quality with code reviews (poetry version)Increasing code quality with code reviews (poetry version)
Increasing code quality with code reviews (poetry version)
 
The Emotionally Intelligent Manager
The Emotionally Intelligent ManagerThe Emotionally Intelligent Manager
The Emotionally Intelligent Manager
 
Discussing Design Without Losing your Mind [Code and Creativity 10/7]
Discussing Design Without Losing your Mind [Code and Creativity 10/7]Discussing Design Without Losing your Mind [Code and Creativity 10/7]
Discussing Design Without Losing your Mind [Code and Creativity 10/7]
 

Recently uploaded

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Recently uploaded (20)

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

Code Reviews: the Good, the Bad, and the Ugly