際際滷

際際滷Share a Scribd company logo
Effective Code Review
21 / 01 / 2020
What is code review?
Code review is systematic examination of computer source code. It is intended to
find mistakes overlooked in the initial development phase, improving the overall
quality of software.
Code Review is the most
important tool we have
Code Review Goals
 Find bugs
 Enforce standards
 Suggest improvements
 Share knowledge
 Learn
Code Review Goals
 Enforce standards
 Scale
 Maintainability
 Performance
 Observable
 Tests
 Clean Code
 Consistency
 Code Reuse
 Readability
 Coding Style
Code reviewee
 You job is to convince the reviewer on your changes
 Be prepared
 Know why your changes are necessary
 Understand where they fit in the bigger picture
 Think about the potential risks
 Be ready to defend your work
 Not everything that code reviewer says must be done
 Always be convinced before accepting suggested changes
 Go over code review checklist
 Do yourself a code review prior to real one
Code Review Checklist
Release
04
 Understand what are the risks of this change
 Release plan: what should be deployed and in what order
 Are there any related projects that this might break?
 PM/Design are aware and approved this to be released?
Tests
03
 All tests passed: unit / integration / e2e / lint
 New tests added for new code
 None relevant tests were deleted
 Changes were tested in local / CI environment
Code
01
 Code is working
 No temporary code
 No redundant comments
 Deleted not used code
Pull Request
02
 PR should be opened
 Commits are complete: commit description / each is working / correct order
 Clear Description
 Branch is rebased on master
Code Reviewer
 Your job is to guard the master
 You must be convinced the suggested changes are an improvement
 Ask for context and understand the reasons for this change
 Deliver knowledge that relates to the topic
 Opportunity to mentor and teach about related areas
 Attach links to article / posts / stack overflow for further reading / learning
 Discuss what can go wrong
 Is this code introduce breaking changes?
 Talk about how this change relates to the general architecture / design
 Reviewer should mind code smells
General Guidelines & Tips
 Best to do the first code review iteration live
 Reviewee give context
 Opportunity for broader discussions
 Inline changes
 Style suggestion: Read the tests first
 The one who started code review needs to finish it
 Every ramped-up team member can do code review
 Merge (and deploy) right after code review is done
 Otherwise, rebase and conflicts may be needed, wasting time doing code review again
 Always write down your comments on PR
 So you wouldnt forget them
 Use resolve / / done to mark completed comments
General Guidelines & Tips
 Always be convinced
 If not, go ask other peers, or manager to settle
 Read every character in PR
 The responsibility for bad code getting to master is on the code reviewer
 Once a code is in master - it is treated as correct
 Even if you dont agree with the style, or with the solution
 Please close stale PRs
 Try to leverage linter instead of obsessing about styling notes
 Always be nice
Thanks!

More Related Content

What's hot (14)

ODT
(6) cpp abstractions inheritance_part_i_exercises
Nico Ludwig
PPTX
03 analysis of_requirementsspecification
Rebecca Jones
PDF
Developers on test
Datio Big Data
PPTX
Lesson 2
Dr. Rupinder Singh
PPTX
SubTests are the Best
Caktus Group
PPTX
The essentials of the IT industry or What I wish I was taught about at Univer...
Equal Experts
ODP
Testing Philosphies
Rob Kaufman
PPTX
Basic software engineering principles - Session 1
LahiruWijewardana1
PPTX
Basic software engineering principles with code examples - Session 2
LahiruWijewardana1
PPTX
Testing activities in continuous integration and continuous delivery as an ex...
Srinivas Kadiyala
PDF
Testing activities in CI/CD as exploratory tester
Srinivas Kadiyala
PPTX
Test Driven Development
Josh Candish
PPTX
Make a better with clean code
Keattiwut Kosittaruk
DOCX
Mi0033 software engineering
smumbahelp
(6) cpp abstractions inheritance_part_i_exercises
Nico Ludwig
03 analysis of_requirementsspecification
Rebecca Jones
Developers on test
Datio Big Data
SubTests are the Best
Caktus Group
The essentials of the IT industry or What I wish I was taught about at Univer...
Equal Experts
Testing Philosphies
Rob Kaufman
Basic software engineering principles - Session 1
LahiruWijewardana1
Basic software engineering principles with code examples - Session 2
LahiruWijewardana1
Testing activities in continuous integration and continuous delivery as an ex...
Srinivas Kadiyala
Testing activities in CI/CD as exploratory tester
Srinivas Kadiyala
Test Driven Development
Josh Candish
Make a better with clean code
Keattiwut Kosittaruk
Mi0033 software engineering
smumbahelp

Similar to Effective Code Review (20)

PDF
Code review best practice
Oren Digmi
PDF
Picking the right architecture and sticking to it
Petter Holmstr旦m
PDF
Basics of writing clean code
Knoldus Inc.
PPTX
Indy meetup#7 effective unit-testing-mule
ikram_ahamed
PDF
The Testers' Secret Weapon - Code Reviews
Bertold Kolics
PDF
The art of being an agile programmer
Claudia Rosu
PPTX
An Introduction To Software Development - Implementation
Blue Elephant Consulting
ODP
PHP Code Quality
Usman Zafar
PDF
Building Sustainable Software: An Introduction to Software Engineering
Muhammad Shehata
PPTX
Capability Building for Cyber Defense: Software Walk through and Screening
Maven Logix
PDF
Write More Durable Code: Principles and Techniques
Ortus Solutions, Corp
PPTX
How to successfully grow a code review culture
Danylenko Max
PDF
Coding Dojo Applied
Vladimir Tarasov
ODP
What is xp
Simone Federici
PPTX
Python: Object-oriented Testing
Damian T. Gordon
PPTX
Test Drive Dirven Driver HAHAahhaha.pptx
findwaytocom
PDF
Software Defect Prevention via Continuous Inspection
Josh Gough
PDF
Code Review for iOS
KLabCyscorpions-TechBlog
PPTX
Tdd and bdd
MohamedSubhiBouchi
PPTX
Javascript Programming according to Industry Standards.pptx
MukundSonaiya1
Code review best practice
Oren Digmi
Picking the right architecture and sticking to it
Petter Holmstr旦m
Basics of writing clean code
Knoldus Inc.
Indy meetup#7 effective unit-testing-mule
ikram_ahamed
The Testers' Secret Weapon - Code Reviews
Bertold Kolics
The art of being an agile programmer
Claudia Rosu
An Introduction To Software Development - Implementation
Blue Elephant Consulting
PHP Code Quality
Usman Zafar
Building Sustainable Software: An Introduction to Software Engineering
Muhammad Shehata
Capability Building for Cyber Defense: Software Walk through and Screening
Maven Logix
Write More Durable Code: Principles and Techniques
Ortus Solutions, Corp
How to successfully grow a code review culture
Danylenko Max
Coding Dojo Applied
Vladimir Tarasov
What is xp
Simone Federici
Python: Object-oriented Testing
Damian T. Gordon
Test Drive Dirven Driver HAHAahhaha.pptx
findwaytocom
Software Defect Prevention via Continuous Inspection
Josh Gough
Code Review for iOS
KLabCyscorpions-TechBlog
Tdd and bdd
MohamedSubhiBouchi
Javascript Programming according to Industry Standards.pptx
MukundSonaiya1
Ad

Recently uploaded (20)

PPT
SF 9_Unit 1.ppt software engineering ppt
AmarrKannthh
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
PDF
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
PDF
How to Buy Verified CashApp Accounts IN 2025
Buy Verified CashApp Accounts
PPTX
CST413 KTU S7 CSE Machine Learning Introduction Parameter Estimation MLE MAP ...
resming1
PDF
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
PDF
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
PDF
NFPA 10 - Estandar para extintores de incendios portatiles (ed.22 ENG).pdf
Oscar Orozco
PDF
Rapid Prototyping for XR: Lecture 5 - Cross Platform Development
Mark Billinghurst
PPTX
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
PDF
01-introduction to the ProcessDesign.pdf
StiveBrack
PPTX
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
PPTX
Computer network Computer network Computer network Computer network
Shrikant317689
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
PDF
Validating a Citizen Observatories enabling Platform by completing a Citizen ...
Diego L坦pez-de-Ipi単a Gonz叩lez-de-Artaza
PPTX
WHO And BIS std- for water quality .pptx
dhanashree78
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
PDF
Designing for Tomorrow Architectures Role in the Sustainability Movement
BIM Services
PDF
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
PPTX
Work at Height training for workers .pptx
cecos12
SF 9_Unit 1.ppt software engineering ppt
AmarrKannthh
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
How to Buy Verified CashApp Accounts IN 2025
Buy Verified CashApp Accounts
CST413 KTU S7 CSE Machine Learning Introduction Parameter Estimation MLE MAP ...
resming1
Rapid Prototyping for XR: Lecture 6 - AI for Prototyping and Research Directi...
Mark Billinghurst
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
NFPA 10 - Estandar para extintores de incendios portatiles (ed.22 ENG).pdf
Oscar Orozco
Rapid Prototyping for XR: Lecture 5 - Cross Platform Development
Mark Billinghurst
Bitumen Emulsion by Dr Sangita Ex CRRI Delhi
grilcodes
01-introduction to the ProcessDesign.pdf
StiveBrack
LECTURE 7 COMPUTATIONS OF LEVELING DATA APRIL 2025.pptx
rr22001247
Computer network Computer network Computer network Computer network
Shrikant317689
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
Validating a Citizen Observatories enabling Platform by completing a Citizen ...
Diego L坦pez-de-Ipi単a Gonz叩lez-de-Artaza
WHO And BIS std- for water quality .pptx
dhanashree78
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
Designing for Tomorrow Architectures Role in the Sustainability Movement
BIM Services
May 2025: Top 10 Read Articles in Data Mining & Knowledge Management Process
IJDKP
Work at Height training for workers .pptx
cecos12
Ad

Effective Code Review

  • 2. What is code review? Code review is systematic examination of computer source code. It is intended to find mistakes overlooked in the initial development phase, improving the overall quality of software.
  • 3. Code Review is the most important tool we have
  • 4. Code Review Goals Find bugs Enforce standards Suggest improvements Share knowledge Learn
  • 5. Code Review Goals Enforce standards Scale Maintainability Performance Observable Tests Clean Code Consistency Code Reuse Readability Coding Style
  • 6. Code reviewee You job is to convince the reviewer on your changes Be prepared Know why your changes are necessary Understand where they fit in the bigger picture Think about the potential risks Be ready to defend your work Not everything that code reviewer says must be done Always be convinced before accepting suggested changes Go over code review checklist Do yourself a code review prior to real one
  • 7. Code Review Checklist Release 04 Understand what are the risks of this change Release plan: what should be deployed and in what order Are there any related projects that this might break? PM/Design are aware and approved this to be released? Tests 03 All tests passed: unit / integration / e2e / lint New tests added for new code None relevant tests were deleted Changes were tested in local / CI environment Code 01 Code is working No temporary code No redundant comments Deleted not used code Pull Request 02 PR should be opened Commits are complete: commit description / each is working / correct order Clear Description Branch is rebased on master
  • 8. Code Reviewer Your job is to guard the master You must be convinced the suggested changes are an improvement Ask for context and understand the reasons for this change Deliver knowledge that relates to the topic Opportunity to mentor and teach about related areas Attach links to article / posts / stack overflow for further reading / learning Discuss what can go wrong Is this code introduce breaking changes? Talk about how this change relates to the general architecture / design Reviewer should mind code smells
  • 9. General Guidelines & Tips Best to do the first code review iteration live Reviewee give context Opportunity for broader discussions Inline changes Style suggestion: Read the tests first The one who started code review needs to finish it Every ramped-up team member can do code review Merge (and deploy) right after code review is done Otherwise, rebase and conflicts may be needed, wasting time doing code review again Always write down your comments on PR So you wouldnt forget them Use resolve / / done to mark completed comments
  • 10. General Guidelines & Tips Always be convinced If not, go ask other peers, or manager to settle Read every character in PR The responsibility for bad code getting to master is on the code reviewer Once a code is in master - it is treated as correct Even if you dont agree with the style, or with the solution Please close stale PRs Try to leverage linter instead of obsessing about styling notes Always be nice

Editor's Notes

  • #9: a code smell is a hint that something has gone wrong somewhere in your code. Use the smell to track down the problem.