SlideShare a Scribd company logo
2
Most read
4
Most read
6
Most read
Code Review
Agenda Introduction Review Type Formal,  over-the-shoulder, email pass-around, pair programming, and tool-assisted reviews Example Open Source Code Review Google Code Review Process Review Board Our Code Review Rules
What’s code review? When one developer writes code, another   developer  ore more   are  asked to review that code A careful line-by-line critique Happens in a non-threatening context Goal is cooperation, not fault-finding Often an integral part of coding process Involuntary code review happens when   debugging someone else's broken code Not so good; emotions may flare
Introduction   Where do  r eview fit in? One of many quality  assurance  tools Design stage Unit Test Code Review User Testing Bug Tracking
Introduction   Code Review Benefits P airs of eyes catch more  defects/ bugs Subtle error of design Code intension Better ideas Enforce coding standards, style guides Keep overall readability & code quality high Accelerate learning Learn from mistakes without breaking stuff Reduce repetition of   errors across the   organization
Introduction   Code Review in Big Comp. All big companies, such as Google, Adobe, Cisco and VMware, adopt code review in software development process Rules Code must be reviewed before submission Code review process is logged for auditors
Model   Formal Code Review From Michael Fagan’s seminal 1976 study at IBM regarding the efficacy of peer reviews A sit down meeting  to review code Steps: planning, introductory meeting, inspection meeting, rework, verification meeting, complete. Follow-Up meeting to improve inspection process
Model   Over the shoulder Review Developer finds available reviewer Developer walks reviewer through the code Reviewer interrupts with questions Developer writes down defects Developer fixes defects in code When developer deems himself finished, he checks in code
Model   Email Pass-around Review Developer emails the code diff to reviewers Reviewers examine the code diff on their own, and send the comments Developer rework until reviewers say OK Developer/Reviewer check in the code change
Model   Pair-Programming Two developers write code at a single workstation with only one developer typing at a time It has continuous free-form discussion and review
Model   Tool-assisted Review Automated file gathering Combined display: differences, comments, defects Automated metrics collection Review enforcement (log and audit)
Example   Open Source Code Review Author & reviewer s  on separate computers Author invokes "diff -u" to create patch file Author mails patch file to reviewer s or uploads to e.g. SourceForge patch manager Reviewer s  uses "patch" to recreate the files They email back-and-forth a few times Finally,  final  reviewer submits into svn/cvs/etc patch author often has no privileges (yet) logs have “signed-off-by reviewers” info
Example   Google Code Review Proc. All command-line and email based: 1. Author edits changes in workspace, tests etc. 2. Author send email to reviewer (a tool helps) 3. Reviewer views the diff (another tool helps) 4. Reviewer sends mail back (regular mail reply) 5. Rinse and repeat (using regular mail replies) 6. When reviewer replies "lgtm", author submits lgtm = looks good to me
Example   Google Code Review Proc. All command-line and email based: 1. Author edits changes in workspace, tests etc. 2. Author send email to reviewer (a tool helps) 3. Reviewer views the diff (another tool helps) 4. Reviewer sends mail back (regular mail reply) 5. Rinse and repeat (using regular mail replies) 6. When reviewer replies "lgtm", author submits lgtm = looks good to me
Review Board An awesome web-based code review tool for companies and open source projects. Developed by Christian Hammond and David Trowbridge at VMware in order to   improve the code review process. Makes code reviews and patch contributions much easier for maintainers and   contributors. See more at the authors’ presentation about Review Board
Our Code Review Rules “ Finish code” isn’t enough Performance Maintainability Consistency Readability Use our  http://rb.eng.teltel.com/  system to review all code change Each project has its owner, who needs to review all the code change
Our Code Review Rules Keep each change atomic and as small as possible LOC to review should be under 200, not to exceed 400 Developer needs to write the description and reason of the change before publishing a review request Commit log should include the URL of this code review at the Review Board system
Rules   During the Review To developer Read all the comments from reviewers carefully Deliver defense in terms of the problem you were trying to solve Your code is on trial, not you To reviewer Criticize the code, not the developer Before declaring a bit of code wrong, ask why it was done the way it was
Resources Code Review Presentation  http://www.numtopia.com/terry/files/codereviews.pdf Review Board Presentation  http://www.review-board.org/presentations/lugradio_usa_2008_reviewboard.pdf rietveld: Code Review for Subversion, hosted on Google App Engine  http:// code.google.com/p/rietveld /

More Related Content

PPTX
Code Review
PPTX
Code review
PPTX
Code Review Best Practices
PPTX
PDF
Clean code
DOCX
Code review guidelines
PDF
Linux systems - Linux Commands and Shell Scripting
PPS
Coding Best Practices
Code Review
Code review
Code Review Best Practices
Clean code
Code review guidelines
Linux systems - Linux Commands and Shell Scripting
Coding Best Practices

What's hot (20)

PPTX
What Is Cucumber?
PPSX
Coding standard
ODP
Test Automation Framework using Cucumber BDD overview (part 1)
PPT
Compiler Construction introduction
PPTX
Coding standards
PPTX
UNIT TESTING PPT
PDF
ATDD Using Robot Framework
PPT
TDD (Test Driven Design)
PPTX
Jenkins CI presentation
PPT
Clean Code summary
PPT
Code Quality
PDF
Gitlab ci-cd
PDF
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
PPTX
Sonarqube
PPTX
Coding standards
PPTX
Software development best practices & coding guidelines
PDF
The Hunter Games: How to Find the Adversary with Event Query Language
ODP
Basic of SSDLC
PDF
SELENIUM PPT.pdf
What Is Cucumber?
Coding standard
Test Automation Framework using Cucumber BDD overview (part 1)
Compiler Construction introduction
Coding standards
UNIT TESTING PPT
ATDD Using Robot Framework
TDD (Test Driven Design)
Jenkins CI presentation
Clean Code summary
Code Quality
Gitlab ci-cd
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Sonarqube
Coding standards
Software development best practices & coding guidelines
The Hunter Games: How to Find the Adversary with Event Query Language
Basic of SSDLC
SELENIUM PPT.pdf
Ad

Viewers also liked (6)

PDF
EGit and Gerrit Code Review - Eclipse DemoCamp Bonn - 2010-11-16
PPT
TYPO3 Code Review Process
PDF
Introduction to Google Summer of Code
PDF
Would Static Analysis Tools Help Developers with Code Reviews?
PDF
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
PDF
"Effektive Code Reviews" - Abendvortrag bei oose.de
EGit and Gerrit Code Review - Eclipse DemoCamp Bonn - 2010-11-16
TYPO3 Code Review Process
Introduction to Google Summer of Code
Would Static Analysis Tools Help Developers with Code Reviews?
Partitioning Composite Code Changes to Facilitate Code Review (MSR2015)
"Effektive Code Reviews" - Abendvortrag bei oose.de
Ad

Similar to Code review (20)

PPT
Code Review
PDF
Code review best practice
PPTX
Software Chapter 5 software testing.pptx
PPTX
code_review_checklist_6_actions_to_improve_the_quality_of_your_reviews.pptx
PPTX
Unit_5 and Unit 6.pptx
PDF
code_review_checklist_6_actions_to_improve_the_quality_of_your_reviews.pdf
PPTX
Expert Code Review best practices
ODP
Documenting Code - Patterns and Anti-patterns - NLPW 2016
KEY
Code Review: An apple a day
PPTX
Software presentation
PDF
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
PDF
Code Review and other aspects of project organization
PDF
Code Review Tool Evaluation
PPTX
An Introduction To Software Development - Implementation
PPTX
Coding, Testing, Black-box and White-box Testing.pptx
PDF
Code-Review-Principles-Process-and-Tools (1)
PDF
Software Defect Prevention via Continuous Inspection
PDF
00.pdf
PPT
Tester developer interaction
Code Review
Code review best practice
Software Chapter 5 software testing.pptx
code_review_checklist_6_actions_to_improve_the_quality_of_your_reviews.pptx
Unit_5 and Unit 6.pptx
code_review_checklist_6_actions_to_improve_the_quality_of_your_reviews.pdf
Expert Code Review best practices
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Code Review: An apple a day
Software presentation
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Code Review and other aspects of project organization
Code Review Tool Evaluation
An Introduction To Software Development - Implementation
Coding, Testing, Black-box and White-box Testing.pptx
Code-Review-Principles-Process-and-Tools (1)
Software Defect Prevention via Continuous Inspection
00.pdf
Tester developer interaction

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
KodekX | Application Modernization Development
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPT
Teaching material agriculture food technology
PPTX
Cloud computing and distributed systems.
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Electronic commerce courselecture one. Pdf
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Understanding_Digital_Forensics_Presentation.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Unlocking AI with Model Context Protocol (MCP)
KodekX | Application Modernization Development
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Teaching material agriculture food technology
Cloud computing and distributed systems.
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
Electronic commerce courselecture one. Pdf
sap open course for s4hana steps from ECC to s4
Understanding_Digital_Forensics_Presentation.pptx
The AUB Centre for AI in Media Proposal.docx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

Code review

  • 2. Agenda Introduction Review Type Formal, over-the-shoulder, email pass-around, pair programming, and tool-assisted reviews Example Open Source Code Review Google Code Review Process Review Board Our Code Review Rules
  • 3. What’s code review? When one developer writes code, another developer ore more are asked to review that code A careful line-by-line critique Happens in a non-threatening context Goal is cooperation, not fault-finding Often an integral part of coding process Involuntary code review happens when debugging someone else's broken code Not so good; emotions may flare
  • 4. Introduction Where do r eview fit in? One of many quality assurance tools Design stage Unit Test Code Review User Testing Bug Tracking
  • 5. Introduction Code Review Benefits P airs of eyes catch more defects/ bugs Subtle error of design Code intension Better ideas Enforce coding standards, style guides Keep overall readability & code quality high Accelerate learning Learn from mistakes without breaking stuff Reduce repetition of errors across the organization
  • 6. Introduction Code Review in Big Comp. All big companies, such as Google, Adobe, Cisco and VMware, adopt code review in software development process Rules Code must be reviewed before submission Code review process is logged for auditors
  • 7. Model Formal Code Review From Michael Fagan’s seminal 1976 study at IBM regarding the efficacy of peer reviews A sit down meeting to review code Steps: planning, introductory meeting, inspection meeting, rework, verification meeting, complete. Follow-Up meeting to improve inspection process
  • 8. Model Over the shoulder Review Developer finds available reviewer Developer walks reviewer through the code Reviewer interrupts with questions Developer writes down defects Developer fixes defects in code When developer deems himself finished, he checks in code
  • 9. Model Email Pass-around Review Developer emails the code diff to reviewers Reviewers examine the code diff on their own, and send the comments Developer rework until reviewers say OK Developer/Reviewer check in the code change
  • 10. Model Pair-Programming Two developers write code at a single workstation with only one developer typing at a time It has continuous free-form discussion and review
  • 11. Model Tool-assisted Review Automated file gathering Combined display: differences, comments, defects Automated metrics collection Review enforcement (log and audit)
  • 12. Example Open Source Code Review Author & reviewer s on separate computers Author invokes "diff -u" to create patch file Author mails patch file to reviewer s or uploads to e.g. SourceForge patch manager Reviewer s uses "patch" to recreate the files They email back-and-forth a few times Finally, final reviewer submits into svn/cvs/etc patch author often has no privileges (yet) logs have “signed-off-by reviewers” info
  • 13. Example Google Code Review Proc. All command-line and email based: 1. Author edits changes in workspace, tests etc. 2. Author send email to reviewer (a tool helps) 3. Reviewer views the diff (another tool helps) 4. Reviewer sends mail back (regular mail reply) 5. Rinse and repeat (using regular mail replies) 6. When reviewer replies "lgtm", author submits lgtm = looks good to me
  • 14. Example Google Code Review Proc. All command-line and email based: 1. Author edits changes in workspace, tests etc. 2. Author send email to reviewer (a tool helps) 3. Reviewer views the diff (another tool helps) 4. Reviewer sends mail back (regular mail reply) 5. Rinse and repeat (using regular mail replies) 6. When reviewer replies "lgtm", author submits lgtm = looks good to me
  • 15. Review Board An awesome web-based code review tool for companies and open source projects. Developed by Christian Hammond and David Trowbridge at VMware in order to improve the code review process. Makes code reviews and patch contributions much easier for maintainers and contributors. See more at the authors’ presentation about Review Board
  • 16. Our Code Review Rules “ Finish code” isn’t enough Performance Maintainability Consistency Readability Use our http://rb.eng.teltel.com/ system to review all code change Each project has its owner, who needs to review all the code change
  • 17. Our Code Review Rules Keep each change atomic and as small as possible LOC to review should be under 200, not to exceed 400 Developer needs to write the description and reason of the change before publishing a review request Commit log should include the URL of this code review at the Review Board system
  • 18. Rules During the Review To developer Read all the comments from reviewers carefully Deliver defense in terms of the problem you were trying to solve Your code is on trial, not you To reviewer Criticize the code, not the developer Before declaring a bit of code wrong, ask why it was done the way it was
  • 19. Resources Code Review Presentation http://www.numtopia.com/terry/files/codereviews.pdf Review Board Presentation http://www.review-board.org/presentations/lugradio_usa_2008_reviewboard.pdf rietveld: Code Review for Subversion, hosted on Google App Engine http:// code.google.com/p/rietveld /