SlideShare a Scribd company logo
1 of 16
Code Reviews: what, why and how



An short introduction to code reviews.


August 17th 2012
Freek de Bruijn (NBIC)
Presentation overview

• what are code reviews, some different ways of reviewing code

• why would you want to do code reviews, what makes sense and
  what not

• how can you do code reviews, real world experience




• David will assist us to review the D2RQ project this afternoon

• we want to invite you to present a project for code review in a
  future meeting
WTFs/minute - Thom Holwerda
What are code reviews?

• take a fresh look at the source code
• goals: improve quality, remove bugs and share knowledge
• different ways:
    •   informal walkthrough (author leads through code)
    •   pair programming (continuous or occasional)
    •   formal inspections (extremely thorough)
    •   discuss informally with a group like this: preferred ways of coding, in-
        depth presentation of a project
• focus is on overall design, class structure, understandable names,
  optimal use of libraries, applicable design patterns and elegant
  code
• focus is not on things you can automatically check with tools (like
  for example CheckStyle, FindBugs and PMD for Java code)
Why do code reviews? (1 of 3)
Why do code reviews? (2 of 3)

•   find and fix bugs as early in the project as possible
•   have constructive discussions on improvement opportunities
•   learn from studying each others code
•   distribute knowledge: collective code ownership
•   educate new team members
•   enhance team spirit and grow collective values
•   it just makes sense, like peer reviewing scientific articles
Looking forward to a code review - Todd Presta
Why NOT do code reviews? (3 of 3)

• doing code reviews take a serious investment and changes the way
  you work
• it takes too much time to really understand new code that does
  anything non-trivial
• developers prefer to spend their time on “their part” of the system
• most of the feedback is very general and/or focuses on minor
  details
• the team is too small to do effective code reviews
• the code will only be used for a short period (or will it?)
• management does not believe in code reviews
• the code is already very good, there’s hardly anything to review…
Be positive - Cyanide & Happiness
How can you do a code review?

• be constructive and positive!

• different ways:
   • informal walkthrough (author leads through code): transfer code,
     introduce new team members, explain to a colleague why you think the
     code should work… ;-)
   • pair programming (continuous or occasional): it is part of the process to
     look at the code and discuss different approaches
   • formal inspections (extremely thorough): next slide
   • discuss informally with a group like this: we will try it out by looking at
     the D2RQ code this afternoon



• you are welcome to suggest a (or your) project for a future code
  review
How can you do a formal inspection (IEEE 1028)?

•management preparation

•planning the review

•overview of review procedures

•[individual] preparation

•[group] examination

•rework/follow-up
Using tools to support code reviews
Where can you find more information?

• interesting articles on Coding Horror with lots of comments
  codinghorror.com/blog/2006/01/code-reviews-just-do-it.html
  codinghorror.com/blog/2007/11/pair-programming-vs-code-
  reviews.html

• Code Review and Software Review described in detail on Wikipedia
  en.wikipedia.org/wiki/Code_review
  en.wikipedia.org/wiki/Software_review
  en.wikipedia.org/wiki/Fagan_inspection

• free book “Best Kept Secrets of Peer Code Review” from SmartBear
  Software (this company offers a code review tool)
  smartbear.com/solutions/white-papers/best-kept-secrets-of-peer-
  code-review
Any questions?
Bonus: culture at IBM (around 1980)

• Triumph of the Nerds (part 2, 5:30-6:52)
  youtube.com/watch?v=IbRmaIzGTOM
  pbs.org/nerds/part2.html

• “IBM is like Switzerland -- conservative, a little dull, yet prosperous.
  It has committees to verify each decision. The safety net is so big
  that it is hard to make a bad decision - or any decision at all.”

• “Rich Seidner, computer programmer and wannabe Paul Simon,
  spent twenty-five years marching in lockstep at IBM. He feels better
  now.”

• “At one point somebody looked at the process to see what's it doing
  and what's the overhead built into it, what they found is that it
  would take at least nine months to ship an empty box.”
Bonus: culture at a small startup (around 1980)

• Triumph of the Nerds (part 1, 6:31-7:18 and 8:49-9:05)
  youtube.com/watch?v=CFL9IyJ_qHk
  pbs.org/nerds/part1.html

• “Their hobby is their business and the culture they've created is
  identical to that of a thousand other technology companies. First,
  they dumped the idea of nine to five. In this industry, you can work
  any 80 hours per week you like.”

• Doug Muise (Software designer): “Eating, bathing, having a
  girlfriend, having an active social life is incidental, it gets in the
  way of code time. Writing code is the primary force that drives our
  lives so anything that interrupts that is wasteful.”

More Related Content

What's hot

To document or not to document? An exploratory study on developers' motivatio...
To document or not to document? An exploratory study on developers' motivatio...To document or not to document? An exploratory study on developers' motivatio...
To document or not to document? An exploratory study on developers' motivatio...Hayim Makabee
 
iOSDC 2018 Presentation - Casual Talk
iOSDC 2018 Presentation - Casual TalkiOSDC 2018 Presentation - Casual Talk
iOSDC 2018 Presentation - Casual Talkkimi Ng
 
Why you should integrate peer code reviews in your software company
Why you should integrate peer code reviews in your software companyWhy you should integrate peer code reviews in your software company
Why you should integrate peer code reviews in your software companyMatts Devriendt
 
Frontend Engineer Hiring Explained at Wix Engineering
Frontend Engineer Hiring Explained at Wix EngineeringFrontend Engineer Hiring Explained at Wix Engineering
Frontend Engineer Hiring Explained at Wix EngineeringTomas Miliauskas
 

What's hot (7)

To document or not to document? An exploratory study on developers' motivatio...
To document or not to document? An exploratory study on developers' motivatio...To document or not to document? An exploratory study on developers' motivatio...
To document or not to document? An exploratory study on developers' motivatio...
 
The bigrewrite
The bigrewriteThe bigrewrite
The bigrewrite
 
iOSDC 2018 Presentation - Casual Talk
iOSDC 2018 Presentation - Casual TalkiOSDC 2018 Presentation - Casual Talk
iOSDC 2018 Presentation - Casual Talk
 
Clean Code Talk (draft)
Clean Code Talk (draft)Clean Code Talk (draft)
Clean Code Talk (draft)
 
Why you should integrate peer code reviews in your software company
Why you should integrate peer code reviews in your software companyWhy you should integrate peer code reviews in your software company
Why you should integrate peer code reviews in your software company
 
Lecture 31
Lecture 31Lecture 31
Lecture 31
 
Frontend Engineer Hiring Explained at Wix Engineering
Frontend Engineer Hiring Explained at Wix EngineeringFrontend Engineer Hiring Explained at Wix Engineering
Frontend Engineer Hiring Explained at Wix Engineering
 

Similar to Code reviews: a short introduction

Code Club - a Fight Club inspired approach to software inspection and review
Code Club - a Fight Club inspired approach to software inspection and reviewCode Club - a Fight Club inspired approach to software inspection and review
Code Club - a Fight Club inspired approach to software inspection and reviewSimon Price
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)Nacho Cougil
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): RevistedMike Harris
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Maven Logix
 
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)ssusercaf6c1
 
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)Nacho Cougil
 
TDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech WeekTDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech WeekNacho Cougil
 
TDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeTDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeNacho Cougil
 
Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0The Linux Foundation
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Jason Tice
 
05 DIGI CREATIVE people&process
05 DIGI CREATIVE people&process05 DIGI CREATIVE people&process
05 DIGI CREATIVE people&processSheSaysCREATIVE
 
What designers can learn from (code) review
What designers can learn from (code) reviewWhat designers can learn from (code) review
What designers can learn from (code) reviewIda Aalen
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviewsnextbuild
 
Introducing Systems Analysis Design Development
Introducing Systems Analysis Design DevelopmentIntroducing Systems Analysis Design Development
Introducing Systems Analysis Design Developmentbsadd
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)Mike Harris
 
On to code review lessons learned at microsoft
On to code review lessons learned at microsoftOn to code review lessons learned at microsoft
On to code review lessons learned at microsoftMichaela Greiler
 
Mob Programming for Continuous Learning
Mob Programming for Continuous LearningMob Programming for Continuous Learning
Mob Programming for Continuous LearningMike Clement
 
Introducing systems analysis, design & development Concepts
Introducing systems analysis, design & development ConceptsIntroducing systems analysis, design & development Concepts
Introducing systems analysis, design & development ConceptsShafiul Azam Chowdhury
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedAlexander Makarov
 

Similar to Code reviews: a short introduction (20)

Code Club - a Fight Club inspired approach to software inspection and review
Code Club - a Fight Club inspired approach to software inspection and reviewCode Club - a Fight Club inspired approach to software inspection and review
Code Club - a Fight Club inspired approach to software inspection and review
 
TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)TDD - Seriously, try it! (updated '22)
TDD - Seriously, try it! (updated '22)
 
Extreme Programming (XP): Revisted
Extreme Programming (XP): RevistedExtreme Programming (XP): Revisted
Extreme Programming (XP): Revisted
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening
 
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
TDD - Seriously, try it! - Trójmiasto Java User Group (17th May '23)
 
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
TDD - Seriously, try it! - Trjjmiasto JUG (17th May '23)
 
TDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech WeekTDD - Seriously, try it! - Bucarest Tech Week
TDD - Seriously, try it! - Bucarest Tech Week
 
TDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - OpensouthcodeTDD - Seriously, try it! - Opensouthcode
TDD - Seriously, try it! - Opensouthcode
 
Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0
 
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
Joe Cisar - Everything I Know About TDD - Agile Midwest 2019
 
05 DIGI CREATIVE people&process
05 DIGI CREATIVE people&process05 DIGI CREATIVE people&process
05 DIGI CREATIVE people&process
 
What designers can learn from (code) review
What designers can learn from (code) reviewWhat designers can learn from (code) review
What designers can learn from (code) review
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviews
 
Introducing Systems Analysis Design Development
Introducing Systems Analysis Design DevelopmentIntroducing Systems Analysis Design Development
Introducing Systems Analysis Design Development
 
It's XP Stupid (2019)
It's XP Stupid (2019)It's XP Stupid (2019)
It's XP Stupid (2019)
 
On to code review lessons learned at microsoft
On to code review lessons learned at microsoftOn to code review lessons learned at microsoft
On to code review lessons learned at microsoft
 
Mob Programming for Continuous Learning
Mob Programming for Continuous LearningMob Programming for Continuous Learning
Mob Programming for Continuous Learning
 
Introducing systems analysis, design & development Concepts
Introducing systems analysis, design & development ConceptsIntroducing systems analysis, design & development Concepts
Introducing systems analysis, design & development Concepts
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 

Recently uploaded

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Code reviews: a short introduction

  • 1. Code Reviews: what, why and how An short introduction to code reviews. August 17th 2012 Freek de Bruijn (NBIC)
  • 2. Presentation overview • what are code reviews, some different ways of reviewing code • why would you want to do code reviews, what makes sense and what not • how can you do code reviews, real world experience • David will assist us to review the D2RQ project this afternoon • we want to invite you to present a project for code review in a future meeting
  • 4. What are code reviews? • take a fresh look at the source code • goals: improve quality, remove bugs and share knowledge • different ways: • informal walkthrough (author leads through code) • pair programming (continuous or occasional) • formal inspections (extremely thorough) • discuss informally with a group like this: preferred ways of coding, in- depth presentation of a project • focus is on overall design, class structure, understandable names, optimal use of libraries, applicable design patterns and elegant code • focus is not on things you can automatically check with tools (like for example CheckStyle, FindBugs and PMD for Java code)
  • 5. Why do code reviews? (1 of 3)
  • 6. Why do code reviews? (2 of 3) • find and fix bugs as early in the project as possible • have constructive discussions on improvement opportunities • learn from studying each others code • distribute knowledge: collective code ownership • educate new team members • enhance team spirit and grow collective values • it just makes sense, like peer reviewing scientific articles
  • 7. Looking forward to a code review - Todd Presta
  • 8. Why NOT do code reviews? (3 of 3) • doing code reviews take a serious investment and changes the way you work • it takes too much time to really understand new code that does anything non-trivial • developers prefer to spend their time on “their part” of the system • most of the feedback is very general and/or focuses on minor details • the team is too small to do effective code reviews • the code will only be used for a short period (or will it?) • management does not believe in code reviews • the code is already very good, there’s hardly anything to review…
  • 9. Be positive - Cyanide & Happiness
  • 10. How can you do a code review? • be constructive and positive! • different ways: • informal walkthrough (author leads through code): transfer code, introduce new team members, explain to a colleague why you think the code should work… ;-) • pair programming (continuous or occasional): it is part of the process to look at the code and discuss different approaches • formal inspections (extremely thorough): next slide • discuss informally with a group like this: we will try it out by looking at the D2RQ code this afternoon • you are welcome to suggest a (or your) project for a future code review
  • 11. How can you do a formal inspection (IEEE 1028)? •management preparation •planning the review •overview of review procedures •[individual] preparation •[group] examination •rework/follow-up
  • 12. Using tools to support code reviews
  • 13. Where can you find more information? • interesting articles on Coding Horror with lots of comments codinghorror.com/blog/2006/01/code-reviews-just-do-it.html codinghorror.com/blog/2007/11/pair-programming-vs-code- reviews.html • Code Review and Software Review described in detail on Wikipedia en.wikipedia.org/wiki/Code_review en.wikipedia.org/wiki/Software_review en.wikipedia.org/wiki/Fagan_inspection • free book “Best Kept Secrets of Peer Code Review” from SmartBear Software (this company offers a code review tool) smartbear.com/solutions/white-papers/best-kept-secrets-of-peer- code-review
  • 15. Bonus: culture at IBM (around 1980) • Triumph of the Nerds (part 2, 5:30-6:52) youtube.com/watch?v=IbRmaIzGTOM pbs.org/nerds/part2.html • “IBM is like Switzerland -- conservative, a little dull, yet prosperous. It has committees to verify each decision. The safety net is so big that it is hard to make a bad decision - or any decision at all.” • “Rich Seidner, computer programmer and wannabe Paul Simon, spent twenty-five years marching in lockstep at IBM. He feels better now.” • “At one point somebody looked at the process to see what's it doing and what's the overhead built into it, what they found is that it would take at least nine months to ship an empty box.”
  • 16. Bonus: culture at a small startup (around 1980) • Triumph of the Nerds (part 1, 6:31-7:18 and 8:49-9:05) youtube.com/watch?v=CFL9IyJ_qHk pbs.org/nerds/part1.html • “Their hobby is their business and the culture they've created is identical to that of a thousand other technology companies. First, they dumped the idea of nine to five. In this industry, you can work any 80 hours per week you like.” • Doug Muise (Software designer): “Eating, bathing, having a girlfriend, having an active social life is incidental, it gets in the way of code time. Writing code is the primary force that drives our lives so anything that interrupts that is wasteful.”

Editor's Notes

  1. IEEE Std 1028 defines a common set of activities for "formal" reviews (with some variations, especially for software audit). The sequence of activities is largely based on the software inspection process originally developed at IBM by Michael Fagan. [3]  Differing types of review may apply this structure with varying degrees of rigour, but all activities are mandatory for inspection: 0. [Entry evaluation]:  The Review Leader uses a standard checklist of entry criteria to ensure that optimum conditions exist for a successful review. 1. Management preparation:  Responsible management ensure that the review will be appropriately resourced with staff, time, materials, and tools, and will be conducted according to policies, standards, or other relevant criteria. 2. Planning the review:  The Review Leader identifies or confirms the objectives of the review, organises a team of Reviewers, and ensures that the team is equipped with all necessary resources for conducting the review. 3. Overview of review procedures:  The Review Leader, or some other qualified person, ensures (at a meeting if necessary) that all Reviewers understand the review goals, the review procedures, the materials available to them, and the procedures for conducting the review. 4. [Individual] Preparation:  The Reviewers individually prepare for group examination of the work under review, by examining it carefully for  anomalies  (potential defects), the nature of which will vary with the type of review and its goals. 5. [Group] Examination:  The Reviewers meet at a planned time to pool the results of their preparation activity and arrive at a consensus regarding the status of the document (or activity) being reviewed. 6. Rework/follow-up:  The Author of the work product (or other assigned person) undertakes whatever actions are necessary to repair defects or otherwise satisfy the requirements agreed to at the Examination meeting. The Review Leader verifies that all action items are closed. 7. [Exit evaluation]:  The Review Leader verifies that all activities necessary for successful review have been accomplished, and that all outputs appropriate to the type of review have been finalised.