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

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

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.