![Page 1: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/1.jpg)
<CODE REVIEWS/>
Why you should do
December 2015
![Page 2: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/2.jpg)
WHO AM I?
Ma!s Devriendt Developer & entrepreneur @iMa!s
![Page 3: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/3.jpg)
Image source: http://image.shutterstock.com/z/stock-photo-portrait-of-alarmed-man-99912533.jpg
CODE REVIEWS ?
![Page 4: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/4.jpg)
Code review is systematic examination (often known as peer
review) of a developer’s source code.
CODE REVIEWS ?
![Page 5: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/5.jpg)
GOAL?
Improve the overall quality of the software product and the knowledge of developers
CODE REVIEWS ?
![Page 6: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/6.jpg)
Image source: http://image.shutterstock.com/z/stock-photo-man-setting-time-on-a-big-clock-91707425.jpg
WHEN & WHAT?
![Page 7: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/7.jpg)
When a developer is finished working on an issue,
another developer looks over the code and considers questions like:
WHEN & WHAT?
![Page 8: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/8.jpg)
1) ERRORS
Are there any obvious logic errors
in the code?
WHEN & WHAT?
![Page 9: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/9.jpg)
2) REQUIREMENTS
Looking at the requirements, are all cases fully implemented?
WHEN & WHAT?
![Page 10: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/10.jpg)
3) TESTS
A) Are the new automated tests sufficient for the new code?
B) Do existing automated tests need to be rewri!en to account
for changes in the code?
WHEN & WHAT?
![Page 11: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/11.jpg)
4) STYLE GUIDELINES
Does the new code conform to existing style guidelines?
WHEN & WHAT?
![Page 12: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/12.jpg)
Image source: http://image.shutterstock.com/z/stock-photo-switchboard-94006822.jpg
WHY DO CODE REVIEWS MATTER?
for developers and (project-)managers
![Page 13: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/13.jpg)
Code is reviewed by another developer
WHY DO CR MATTER?
![Page 14: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/14.jpg)
Code is reviewed by another developer
WHY DO CR MATTER?
Developers will be more likely to write comments and tests
Better code quality & less bugs
New employees come up to speed faster
ü Knowledge of other developers: possible improvements, new classes/methods/libraries, new insights, be!er ways, …
ü Because developer knows his/her code will be reviewed
![Page 15: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/15.jpg)
No one is the only person who knows a specific part
of the code base
WHY DO CR MATTER?
![Page 16: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/16.jpg)
No one is the only person who knows a specific part
of the code base
WHY DO CR MATTER?
Teamwork
Flexibility:
Shared responsibility
ü Others can help out if needed (to meet deadlines) They can take work of the backlog and start programming
ü Be!er control of resources: developers can be interchanged more easily (they will already know about the source code)
![Page 17: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/17.jpg)
No one is the only person who knows a specific part
of the code base
WHY DO CR MATTER?
Less human resources problems:
Peace of mind
When only 1 person knows about the source code of a program: What if he/she is not in the office? Or worse: what if he/she left the company… “Hé can you do a small bugfix because Mr. X is not here and things are failing on the production server?”
No one is the critical path
![Page 18: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/18.jpg)
Knowledge sharing
WHY DO CR MATTER?
![Page 19: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/19.jpg)
Knowledge sharing
WHY DO CR MATTER?
Opportunity to learn about a new languages, libraries and frameworks.
Hidden knowledge
New SDKs
‘Known issues’
![Page 20: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/20.jpg)
And many other advantages…
WHY DO CR MATTER?
Early feedback in development process
Extra efforts of developers for well-designed code and passing tests
Shared load
No code gets in unreviewed
(code written at 3am or by inters)
![Page 21: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/21.jpg)
Image source: http://image.shutterstock.com/z/stock-photo-teacher-holding-a-book-in-front-of-a-black-board-looking-surprised-92438437.jpg
PRACTICAL TIPS
![Page 22: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/22.jpg)
Review as soon as possible, before merging
PRACTICAL TIPS
Use git-pull or work with a branch-approach where a feature-
branch can only be merged to development if it’s reviewed
![Page 23: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/23.jpg)
How fast should code be reviewed?
PRACTICAL TIPS
200-300 lines of code / hour
Background image: Smartbear - Cisco Case Study - Plotting inspection size versus time at Cisco. There is no apparent systematic "inspection rate.”
![Page 24: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/24.jpg)
Take time for a decent review
PRACTICAL TIPS
Source: Smartbear - Cisco Case Study
Reviewers become less effective at finding defects as their pace through the review accelerates.
![Page 25: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/25.jpg)
How much lines should be reviewed at a time?
PRACTICAL TIPS
Reviewers are most effective at reviewing small amounts of code.
200 – 400 lines
Source: Smartbear - Cisco Case Study
![Page 26: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/26.jpg)
Total review time
PRACTICAL TIPS
Less than 60 minutes, max 90 minutes
Source: Smartbear - Cisco Case Study
![Page 27: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/27.jpg)
Image source: http://image.shutterstock.com/z/stock-photo-parents-visiting-day-93711238.jpg
CODE REVIEWS ARE PART OF THE AGILE APPROACH, COMBINE CODE
REVIEWS WITH CONTINUOUS INTEGRATION, TESTING, SCRUM, …
AND AIM FOR ULTIMATE FLEXIBILITY!
![Page 28: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/28.jpg)
Image source: http://image.shutterstock.com/z/stock-photo-group-of-photographers-taking-picture-with-cameras-99830894.jpg
QUESTIONS? START CODE REVIEWING!
![Page 29: Why you should integrate peer code reviews in your software company](https://reader030.vdocuments.us/reader030/viewer/2022032613/5878121a1a28ab971e8b73c9/html5/thumbnails/29.jpg)
Sources and references • h#ps://www.atlassian.com/agile/code-‐reviews • h#p://support.smartbear.com/support/media/resources/cc/book/code-‐review-‐cisco-‐case-‐
study.pdf