SlideShare a Scribd company logo
1 of 30
Download to read offline
10 faulty
review
code
behaviors of
LEMi ORHAN ERGiN
co-founder @ craftbase
/lemiorhan
lemiorhanergin.com
@lemiorhan
LEMi ORHAN ERGiN
agile software craftsman
co-founder @ Craftbase
ex Sony, eBay/GittiGidiyor, ACM, iyzico
founder of Software Craftsmanship
Turkey Community
Benefits of Code Review
Benefits of Code Review
Better Code
Common Ownership Knowledge Sharing
Finding Defects
The whole team is fully responsible to
create a well-crafted software. If it means
to review every single line of code, then
the team reviews every line of code.
We learn how others design and
implement software. We see new ways of
coding, alternative solutions and know-
how about the domain.
Code becomes more optimized, cleaner
and better in both security and
performance. Since it is reviewed by
another brain, suggestions improve code.
Much far before the code goes to
production, we can notice bugs just by
reading the code. That is cheap, much
cheaper than expected.
Efficiency of Code Review
Techniques
mob programming
pair programming
pull requests
code review sessions
over the shoulder
code buddy
via review tools
HIGHER
LOWER
Prerequisites Opening Review Closing
4 STEPS OF
CODE REVIEWAND 10 FAULTY BEHAVIORS
1
no standards in the team
Discussing again and again on the same topics
Reviewing broken code
Writing comments does not change anything
Endless discussions, no conclusions
PREREQUISITES
1 make agreements in the team
Teams should own the process and improve it with retrospectives
Tests and CI Mechanism
Automated tests and CI mechanism should run before every PR
Standards
Agree on standards on conventions and process, and improve
it continuously
Responsibilities
Reviewers are responsible for the bugs, not the authors
Ownership
PREREQUISITES
2
ambiguous content to review
A big whale of code is waiting in the review
No information at commit messages or PR descriptions
Author comments required for clarification
Old comments are gone. Where are my comments?
OPENING
2OPENING
better PRs lead better reviews
Keep change set small
Big change sets distracts focus. Keep it small to complete in max 30 mins.
Better messages
Commit messages and PR descriptions should contain as much
information as it cold be, such as design decisions and test scenarios.
Review by yourself again
Statistics say that author review beforehand decreases the number of
defects dramatically and leads to cleaner code and safer review process
3
wrong reviewer selection
Waiting feedback from too many people
Always selecting the same people as the reviewer
Randomly selecting reviewers
Who the hell should I open my review to?
OPENING
3OPENING
make the review load bearable
Select max 2-3 reviewers
If you open to the whole team, expect to get feedback from
max 2 people.
Select from old authors
By using git-guilt script, you can find who touched the code
you worked in the past. Then you can open reviews to them.
Open reviews not to the same people
Remember that each review takes approx. 30 mins average. It
means it takes time. So show respect to people’s workload.
4
too late for asking for feedback
Opening to code review after merging back to source
Ask for review after 1 month work
Deadline has arrived but you haven’t opened PR yet
Code review branches in everywhere in git
OPENING
4OPENING
review before it’s merged and
the feature is ready
Open Pull Requests to automize reviews
PRs are the best way to gather feedback before the change set
is merged to source.
Use a branching model
Every branching model has its own dynamics for reviewing
code (Git-Flow, GitWeb Flow, Trunk based development, etc.)
Branching is evil, stay there short
When you create a branch, you go out of CI and can work with
no obligation to have a stable state. That’s evil. Know it.
PR
5
cannot understand
Having no tests. Cannot understand what code really does.
Not knowing where to look while reviewing.
Tons of syntactical feedback, but nothing from business logic.
I don’t know the code better than the author.
CODE REVIEW
what the change set is doing
make the review process

more structured
Have a checklist of topics to review
It is important to look at where to look in correct mindset.
Prepare a checklist of topics and review the code with each.
Write tests
Minds cannot compile or run the code. Without tests, code is
simply a puzzle to solve with our imagination.
Write description about the business
It would not be possible to have reviewers knowledgable
about the business as you are. Give information about the
business at PR descriptions and commit messages.
5CODE REVIEW
6
this is my code, my expertise
Looking just the change set during the review.
Not touching someone else’s code.
Improvement suggestions are never applied.
I know the code better than anyone. How dare you are?
CODE REVIEW
this is our code, our expertise
Review the whole section
Change sets cannot be separated from its code unit. We
should review both the change sets and its belonging unit.
Fix other’s code
Because there is nothing such as “other’s code”. Code belongs to
the team, not individuals. So fix whenever you notice a defect.
Apply suggestions now
If you get an improvement suggestion during code review, apply
them now. Of course nice to haves could wait a little bit longer:)
6CODE REVIEW
7
others are stupid
I know better than others. They code the legacy.
“This code is totally wrong. Haven’t you read the book?”
Women is not biologically suitable for programming.
Others try to destroy my reputation.
CODE REVIEW
trying to prove
leave your ego
and do not make it personal
Egoless Programming
Accept that you are not your code, you will make mistakes and
someone else will know more than you.
Be kind
Be gentle, keep tone positive. Be thankful. Point out good stuff.
No need for jokes, the words “always”, “never”, “mine”, “yours”.
Respect the legacy code
Keep in mind that many bad decisions were taken due to limitations
of the past. So respect them and try to understand conditions of the
past and reasons of the decisions.
7CODE REVIEW
8
not able to convince people
Writing lots of comments and getting no response.
I am sure I am right but I cannot convince my solution is better
We discuss but never conclude on my proposals
Hearing “this is how we do in this team”
CODE REVIEW
about our review comments
sell your ideas
like people sell products
Support your idea with arguments
Collect code snippets, links, tutorials, and any resource that can
give detailed explanation about your comment.
Make your idea feel like a better alternative
Never judge the decisions. Instead show your idea in all aspects
and make it feel like a better alternative solution.
Prefer discussions over comments
Still face to face communication is the best way to find the best
solution and improve.
8CODE REVIEW
9
people play dead
No time for code review due to work load
PRs stay open unmerged for too long
Asking a question but getting no response
Everyone asks feedback but no-one gives one
CODE REVIEW
when I create a PR and ask for feedback
no-one can play dead while
communicating face to face
Shout out loud if you need urgent feedback
If you need help and instant feedback from your teammates,
simply go and ask for it.
Make code review a ritual
In order to make code review a habit, make it a regular ritual, like
“the review hour” on the last hour of every work day.
Go and review code together
If you get no response from the author, do not wait. Just go to hem/
her and review code together.
9CODE REVIEW
10
premature closing
Merging the PR without reviewing due to deadline pressure
Merging after getting one acceptance
Merging even though the discussions are going on
Managers order to merge the unreviewed code
CLOSING
never merge an unfinished PR
Be principled, have standards
If a PR is not reviewed, it cannot be merged. If the review of a
PR is not finished, it cannot be merged. Stop.
Ask for immediate help
If your code stayed unreviewed for a while and the deadline
comes, ask from someone else for an immediate feedback.
10CLOSING
no standards in the team
ambiguous content
wrong reviewer selection
too late for asking for feedback
cannot understand what the change set is doing
this is my code, my expertise
trying to prove others are stupid
not able to convince people about our review comments
people play dead when I create a PR and ask for feedback
premature closing
1
2
3
4
5
6
7
8
9
10
10 FAULTY BEHAVIORS of CODE REVIEW
/lemiorhan
lemiorhanergin.com
@lemiorhanLEMi ORHAN ERGiN

More Related Content

Similar to 10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018

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
 
성공적인코드리뷰 문화 사내 발표
성공적인코드리뷰 문화 사내 발표성공적인코드리뷰 문화 사내 발표
성공적인코드리뷰 문화 사내 발표Byoenghan Baek
 
Clean Code Software Engineering
Clean Code Software Engineering Clean Code Software Engineering
Clean Code Software Engineering Inocentshuja Ahmad
 
Working together
Working togetherWorking together
Working togetherhimaye
 
Code review Effective - kwan
Code review  Effective - kwanCode review  Effective - kwan
Code review Effective - kwanThamara Hessel
 
How to successfully grow a code review culture
How to successfullygrow a code review cultureHow to successfullygrow a code review culture
How to successfully grow a code review cultureDanylenko Max
 
What every developer can learn from startups
What every developer can learn from startupsWhat every developer can learn from startups
What every developer can learn from startupsOleg Podsechin
 
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)Peter Gfader
 
Code Reviews: the Good, the Bad, and the Ugly
Code Reviews: the Good, the Bad, and the UglyCode Reviews: the Good, the Bad, and the Ugly
Code Reviews: the Good, the Bad, and the UglyAmanda Sopkin
 
Code Review Best Practices
Code Review Best PracticesCode Review Best Practices
Code Review Best PracticesTrisha Gee
 
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 - 2020Syeda Kauser Inamdar
 
11 rules for programmer should live by
11 rules for programmer should live by11 rules for programmer should live by
11 rules for programmer should live byYe Win
 
Code review best practice
Code review best practiceCode review best practice
Code review best practiceOren Digmi
 
Code Quality Makes Your Job Easier
Code Quality Makes Your Job EasierCode Quality Makes Your Job Easier
Code Quality Makes Your Job EasierTonya Mork
 
Effective Code Reviews (IPC 2018)
Effective Code Reviews (IPC 2018)Effective Code Reviews (IPC 2018)
Effective Code Reviews (IPC 2018)Frank Sons
 
Prefer Code to Comments
Prefer Code to CommentsPrefer Code to Comments
Prefer Code to CommentsKevlin Henney
 

Similar to 10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018 (20)

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)
 
성공적인코드리뷰 문화 사내 발표
성공적인코드리뷰 문화 사내 발표성공적인코드리뷰 문화 사내 발표
성공적인코드리뷰 문화 사내 발표
 
Code reviews
Code reviewsCode reviews
Code reviews
 
Clean Code Software Engineering
Clean Code Software Engineering Clean Code Software Engineering
Clean Code Software Engineering
 
Working together
Working togetherWorking together
Working together
 
Code review Effective - kwan
Code review  Effective - kwanCode review  Effective - kwan
Code review Effective - kwan
 
How to successfully grow a code review culture
How to successfullygrow a code review cultureHow to successfullygrow a code review culture
How to successfully grow a code review culture
 
What every developer can learn from startups
What every developer can learn from startupsWhat every developer can learn from startups
What every developer can learn from startups
 
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
You Cant Be Agile If Your Code Sucks (with 9 Tips For Dev Teams)
 
Code Reviews: the Good, the Bad, and the Ugly
Code Reviews: the Good, the Bad, and the UglyCode Reviews: the Good, the Bad, and the Ugly
Code Reviews: the Good, the Bad, and the Ugly
 
Code Review Best Practices
Code Review Best PracticesCode Review Best Practices
Code Review Best Practices
 
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
 
Code review
Code reviewCode review
Code review
 
11 rules for programmer should live by
11 rules for programmer should live by11 rules for programmer should live by
11 rules for programmer should live by
 
Best pratice
Best praticeBest pratice
Best pratice
 
Gateway to Agile: XP and BDD
Gateway to Agile: XP and BDD Gateway to Agile: XP and BDD
Gateway to Agile: XP and BDD
 
Code review best practice
Code review best practiceCode review best practice
Code review best practice
 
Code Quality Makes Your Job Easier
Code Quality Makes Your Job EasierCode Quality Makes Your Job Easier
Code Quality Makes Your Job Easier
 
Effective Code Reviews (IPC 2018)
Effective Code Reviews (IPC 2018)Effective Code Reviews (IPC 2018)
Effective Code Reviews (IPC 2018)
 
Prefer Code to Comments
Prefer Code to CommentsPrefer Code to Comments
Prefer Code to Comments
 

More from Lemi Orhan Ergin

Clean Software Design: The Practices to Make The Design Simple
Clean Software Design: The Practices to Make The Design SimpleClean Software Design: The Practices to Make The Design Simple
Clean Software Design: The Practices to Make The Design SimpleLemi Orhan Ergin
 
Unwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingUnwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingLemi Orhan Ergin
 
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...Lemi Orhan Ergin
 
Irresponsible Disclosure: Short Handbook of an Ethical Developer
Irresponsible Disclosure: Short Handbook of an Ethical DeveloperIrresponsible Disclosure: Short Handbook of an Ethical Developer
Irresponsible Disclosure: Short Handbook of an Ethical DeveloperLemi Orhan Ergin
 
Scrum Events and Artifacts in Action
Scrum Events and Artifacts in ActionScrum Events and Artifacts in Action
Scrum Events and Artifacts in ActionLemi Orhan Ergin
 
DevOps & Technical Agility: From Theory to Practice
DevOps & Technical Agility: From Theory to PracticeDevOps & Technical Agility: From Theory to Practice
DevOps & Technical Agility: From Theory to PracticeLemi Orhan Ergin
 
Fighting with Waste Driven Development - XP Days Ukraine 2017
Fighting with Waste Driven Development - XP Days Ukraine 2017Fighting with Waste Driven Development - XP Days Ukraine 2017
Fighting with Waste Driven Development - XP Days Ukraine 2017Lemi Orhan Ergin
 
Git Anti Patterns - XP Days Ukraine 2017
Git Anti Patterns - XP Days Ukraine 2017Git Anti Patterns - XP Days Ukraine 2017
Git Anti Patterns - XP Days Ukraine 2017Lemi Orhan Ergin
 
Waste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia MeetupWaste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia MeetupLemi Orhan Ergin
 
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Lemi Orhan Ergin
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Lemi Orhan Ergin
 
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...Lemi Orhan Ergin
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainLemi Orhan Ergin
 
Clean Software Design - DevNot Summit Istanbul 2017
Clean Software Design - DevNot Summit Istanbul 2017Clean Software Design - DevNot Summit Istanbul 2017
Clean Software Design - DevNot Summit Istanbul 2017Lemi Orhan Ergin
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Lemi Orhan Ergin
 
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...Lemi Orhan Ergin
 
Happy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of DevelopersHappy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of DevelopersLemi Orhan Ergin
 
Git - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilGit - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilLemi Orhan Ergin
 
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationCode Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationLemi Orhan Ergin
 
Lost in Motivation in an Agile World
Lost in Motivation in an Agile WorldLost in Motivation in an Agile World
Lost in Motivation in an Agile WorldLemi Orhan Ergin
 

More from Lemi Orhan Ergin (20)

Clean Software Design: The Practices to Make The Design Simple
Clean Software Design: The Practices to Make The Design SimpleClean Software Design: The Practices to Make The Design Simple
Clean Software Design: The Practices to Make The Design Simple
 
Unwritten Manual for Pair Programming
Unwritten Manual for Pair ProgrammingUnwritten Manual for Pair Programming
Unwritten Manual for Pair Programming
 
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
Yeni Nesil Yazılım Kültürü: Daha İyi Profesyoneller, Daha Kaliteli Yazılım, D...
 
Irresponsible Disclosure: Short Handbook of an Ethical Developer
Irresponsible Disclosure: Short Handbook of an Ethical DeveloperIrresponsible Disclosure: Short Handbook of an Ethical Developer
Irresponsible Disclosure: Short Handbook of an Ethical Developer
 
Scrum Events and Artifacts in Action
Scrum Events and Artifacts in ActionScrum Events and Artifacts in Action
Scrum Events and Artifacts in Action
 
DevOps & Technical Agility: From Theory to Practice
DevOps & Technical Agility: From Theory to PracticeDevOps & Technical Agility: From Theory to Practice
DevOps & Technical Agility: From Theory to Practice
 
Fighting with Waste Driven Development - XP Days Ukraine 2017
Fighting with Waste Driven Development - XP Days Ukraine 2017Fighting with Waste Driven Development - XP Days Ukraine 2017
Fighting with Waste Driven Development - XP Days Ukraine 2017
 
Git Anti Patterns - XP Days Ukraine 2017
Git Anti Patterns - XP Days Ukraine 2017Git Anti Patterns - XP Days Ukraine 2017
Git Anti Patterns - XP Days Ukraine 2017
 
Waste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia MeetupWaste Driven Development - Agile Coaching Serbia Meetup
Waste Driven Development - Agile Coaching Serbia Meetup
 
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
Git Anti-Patterns - Extended Version With 28 Common Anti-Patterns) - SCTurkey...
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
Git Anti-Patterns: How To Mess Up With Git and Love it Again - DevoxxPL 2017
 
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
Yazılım Geliştirme Kültürünün Kodları: Motivasyon, Teknik Mükemmellik ve İnov...
 
Git Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it AgainGit Anti-Patterns: How To Mess Up With Git and Love it Again
Git Anti-Patterns: How To Mess Up With Git and Love it Again
 
Clean Software Design - DevNot Summit Istanbul 2017
Clean Software Design - DevNot Summit Istanbul 2017Clean Software Design - DevNot Summit Istanbul 2017
Clean Software Design - DevNot Summit Istanbul 2017
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016
 
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
Let The Elephants Leave The Room - Remove Waste in Software Development - Bos...
 
Happy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of DevelopersHappy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
Happy Developer's Guide to the Galaxy: Thinking About Motivation of Developers
 
Git - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi DeğilGit - Bildiğiniz Gibi Değil
Git - Bildiğiniz Gibi Değil
 
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your OrganizationCode Your Agility - Tips for Boosting Technical Agility in Your Organization
Code Your Agility - Tips for Boosting Technical Agility in Your Organization
 
Lost in Motivation in an Agile World
Lost in Motivation in an Agile WorldLost in Motivation in an Agile World
Lost in Motivation in an Agile World
 

Recently uploaded

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
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.pdfproinshot.com
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
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 CCTVshikhaohhpro
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
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..pdfPearlKirahMaeRagusta1
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
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-learnAmarnathKambale
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfayushiqss
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
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...panagenda
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
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 GoalsJhone kinadey
 

Recently uploaded (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
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
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
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
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
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
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
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
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
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...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
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
 

10 Faulty Behaviors of Code Review - Developer Summit Istanbul 2018

  • 1. 10 faulty review code behaviors of LEMi ORHAN ERGiN co-founder @ craftbase
  • 2.
  • 3.
  • 4. /lemiorhan lemiorhanergin.com @lemiorhan LEMi ORHAN ERGiN agile software craftsman co-founder @ Craftbase ex Sony, eBay/GittiGidiyor, ACM, iyzico founder of Software Craftsmanship Turkey Community
  • 6. Benefits of Code Review Better Code Common Ownership Knowledge Sharing Finding Defects The whole team is fully responsible to create a well-crafted software. If it means to review every single line of code, then the team reviews every line of code. We learn how others design and implement software. We see new ways of coding, alternative solutions and know- how about the domain. Code becomes more optimized, cleaner and better in both security and performance. Since it is reviewed by another brain, suggestions improve code. Much far before the code goes to production, we can notice bugs just by reading the code. That is cheap, much cheaper than expected.
  • 7. Efficiency of Code Review Techniques mob programming pair programming pull requests code review sessions over the shoulder code buddy via review tools HIGHER LOWER
  • 8. Prerequisites Opening Review Closing 4 STEPS OF CODE REVIEWAND 10 FAULTY BEHAVIORS
  • 9. 1 no standards in the team Discussing again and again on the same topics Reviewing broken code Writing comments does not change anything Endless discussions, no conclusions PREREQUISITES
  • 10. 1 make agreements in the team Teams should own the process and improve it with retrospectives Tests and CI Mechanism Automated tests and CI mechanism should run before every PR Standards Agree on standards on conventions and process, and improve it continuously Responsibilities Reviewers are responsible for the bugs, not the authors Ownership PREREQUISITES
  • 11. 2 ambiguous content to review A big whale of code is waiting in the review No information at commit messages or PR descriptions Author comments required for clarification Old comments are gone. Where are my comments? OPENING
  • 12. 2OPENING better PRs lead better reviews Keep change set small Big change sets distracts focus. Keep it small to complete in max 30 mins. Better messages Commit messages and PR descriptions should contain as much information as it cold be, such as design decisions and test scenarios. Review by yourself again Statistics say that author review beforehand decreases the number of defects dramatically and leads to cleaner code and safer review process
  • 13. 3 wrong reviewer selection Waiting feedback from too many people Always selecting the same people as the reviewer Randomly selecting reviewers Who the hell should I open my review to? OPENING
  • 14. 3OPENING make the review load bearable Select max 2-3 reviewers If you open to the whole team, expect to get feedback from max 2 people. Select from old authors By using git-guilt script, you can find who touched the code you worked in the past. Then you can open reviews to them. Open reviews not to the same people Remember that each review takes approx. 30 mins average. It means it takes time. So show respect to people’s workload.
  • 15. 4 too late for asking for feedback Opening to code review after merging back to source Ask for review after 1 month work Deadline has arrived but you haven’t opened PR yet Code review branches in everywhere in git OPENING
  • 16. 4OPENING review before it’s merged and the feature is ready Open Pull Requests to automize reviews PRs are the best way to gather feedback before the change set is merged to source. Use a branching model Every branching model has its own dynamics for reviewing code (Git-Flow, GitWeb Flow, Trunk based development, etc.) Branching is evil, stay there short When you create a branch, you go out of CI and can work with no obligation to have a stable state. That’s evil. Know it. PR
  • 17. 5 cannot understand Having no tests. Cannot understand what code really does. Not knowing where to look while reviewing. Tons of syntactical feedback, but nothing from business logic. I don’t know the code better than the author. CODE REVIEW what the change set is doing
  • 18. make the review process
 more structured Have a checklist of topics to review It is important to look at where to look in correct mindset. Prepare a checklist of topics and review the code with each. Write tests Minds cannot compile or run the code. Without tests, code is simply a puzzle to solve with our imagination. Write description about the business It would not be possible to have reviewers knowledgable about the business as you are. Give information about the business at PR descriptions and commit messages. 5CODE REVIEW
  • 19. 6 this is my code, my expertise Looking just the change set during the review. Not touching someone else’s code. Improvement suggestions are never applied. I know the code better than anyone. How dare you are? CODE REVIEW
  • 20. this is our code, our expertise Review the whole section Change sets cannot be separated from its code unit. We should review both the change sets and its belonging unit. Fix other’s code Because there is nothing such as “other’s code”. Code belongs to the team, not individuals. So fix whenever you notice a defect. Apply suggestions now If you get an improvement suggestion during code review, apply them now. Of course nice to haves could wait a little bit longer:) 6CODE REVIEW
  • 21. 7 others are stupid I know better than others. They code the legacy. “This code is totally wrong. Haven’t you read the book?” Women is not biologically suitable for programming. Others try to destroy my reputation. CODE REVIEW trying to prove
  • 22. leave your ego and do not make it personal Egoless Programming Accept that you are not your code, you will make mistakes and someone else will know more than you. Be kind Be gentle, keep tone positive. Be thankful. Point out good stuff. No need for jokes, the words “always”, “never”, “mine”, “yours”. Respect the legacy code Keep in mind that many bad decisions were taken due to limitations of the past. So respect them and try to understand conditions of the past and reasons of the decisions. 7CODE REVIEW
  • 23. 8 not able to convince people Writing lots of comments and getting no response. I am sure I am right but I cannot convince my solution is better We discuss but never conclude on my proposals Hearing “this is how we do in this team” CODE REVIEW about our review comments
  • 24. sell your ideas like people sell products Support your idea with arguments Collect code snippets, links, tutorials, and any resource that can give detailed explanation about your comment. Make your idea feel like a better alternative Never judge the decisions. Instead show your idea in all aspects and make it feel like a better alternative solution. Prefer discussions over comments Still face to face communication is the best way to find the best solution and improve. 8CODE REVIEW
  • 25. 9 people play dead No time for code review due to work load PRs stay open unmerged for too long Asking a question but getting no response Everyone asks feedback but no-one gives one CODE REVIEW when I create a PR and ask for feedback
  • 26. no-one can play dead while communicating face to face Shout out loud if you need urgent feedback If you need help and instant feedback from your teammates, simply go and ask for it. Make code review a ritual In order to make code review a habit, make it a regular ritual, like “the review hour” on the last hour of every work day. Go and review code together If you get no response from the author, do not wait. Just go to hem/ her and review code together. 9CODE REVIEW
  • 27. 10 premature closing Merging the PR without reviewing due to deadline pressure Merging after getting one acceptance Merging even though the discussions are going on Managers order to merge the unreviewed code CLOSING
  • 28. never merge an unfinished PR Be principled, have standards If a PR is not reviewed, it cannot be merged. If the review of a PR is not finished, it cannot be merged. Stop. Ask for immediate help If your code stayed unreviewed for a while and the deadline comes, ask from someone else for an immediate feedback. 10CLOSING
  • 29. no standards in the team ambiguous content wrong reviewer selection too late for asking for feedback cannot understand what the change set is doing this is my code, my expertise trying to prove others are stupid not able to convince people about our review comments people play dead when I create a PR and ask for feedback premature closing 1 2 3 4 5 6 7 8 9 10 10 FAULTY BEHAVIORS of CODE REVIEW