Upload
hakan-saglam
View
152
Download
0
Tags:
Embed Size (px)
Citation preview
Hakan Saglam
developing since 2000doing code review since 2004
software developer @ havelsanlead software developer @ oytek
project manager @ software agtechnical coordinator @ sony
solution architect @ sony
head of mobile development @ peak games
It is intended to find and fix mistakes overlooked in the initial development phase,
improving both the overall quality of software and the developers' skills.
CODE INSPECTION
INTRODUCED BY MICHAEL FAGAN IN 1976
one hour of inspection
20 hours of testing
82 hours rework
Each hour of inspection saved 20 hours of testing and 82 hours of rework effort had the defects found by
inspection remained in the released products.
If we do review at the earlier stage, the cost to fix this will be
less. It is 2400% cheaper to fix any issues in development
stage than in the production environment.
http://www.kunal-chowdhury.com/2013/06/code-review-and-its-importance.html
http://www.veracode.com/blog/2015/03/how-code-review-best-practices-saved-one-company-millions
CULTURE
Every Code Review is an opportunity to learn and teach. And a very simple way to build
an engineering culture.https://flic.kr/p/89YLs1
ALL TEAM
Team Leader
Junior Developer
Senior Developer
SolutionArchitect
TechnicalSpecialist
https://flic.kr/p/9XdG3M
The social incentives inherent in voluntary code review policies
encourage developers to take ownership of the code.
AUTONOMY
http://alysonschafer.com/wp-content/uploads/2014/08/autonomy_makes_children_more_responsible.jpg
DEFINITION OF DONE
An agreed team definition of done is essential to produce
high quality code.
teamhttps://flic.kr/p/8oXJWd
http://www.slideshare.net/lemiorhan/fix-your-broken-windows-with-code-review-phpist14
Reorder commits with rebaseto make the review easier.
author
LET’S DOCODE
REVIEWInstead of finding your own solution, try to understand author’s solution.
https://flic.kr/p/4eLyGdreviewer
MASLOW PYRAMID OF CODE REVIEW
CORRECTSECURE READABLE
ELEGANTALTURIST
reviewer
http://blog.d3in.org/post/111338685456/maslows-pyramid-of-code-review
CORRECT
• Does the code do what it’s supposed to? • Does it handle edge cases? • Is it adequately tested to make sure that it stays correct? • Is it performant enough for this use case?
reviewer
SECURE
• Does the code have vulnerabilities?• Is the data stored safely? • Is personal identification information handled correctly? • Could the code be used to induce a DOS? • Is input validation comprehensive enough?
reviewer
READABLE
• Is the code easy to read and comprehend? • Does it make clear what the business requirements are?• Are variables, functions and classes named appropriately? • Does it use consistent coding convention?
reviewer
ELEGANT
• Does the code leverage well-known patterns? • Does it achieve what it needs to do without sacrificing
simplicity and conciseness?• Does the code reuse existing functions when applicable?• Would you be proud of this code?
reviewer
ALTURIST
• Does the code leave the codebase better than what it was?
• Does it inspire other engineers to improve their code? • Is it cleaning up unused code?• Is it improving documentation, introducing better patterns
through small-scale refactoring?
reviewer
reviewer
CHECKLIST
Develop your own domain and language specific checklist both for better review and
better coding.
MERGEPULL REQUEST
reviewerhttp://www.inc.com/uploaded_files/image/how-to-merge-corporate-culutres-pop_8709.jpg
https://www.previousnext.com.au/blog/automated-drupal-testing-github-pull-requests
CODEREVIEWviaTOOLS
RECAP
pair
SOME TASKS
NEEDS TO BE COMPLETED
IN ONE BLOCK
OF TIME
http://groundedpsyche.com/wp-content/uploads/2015/01/Iceberg.png
team
GETTING READY FOR NEW
TECHNOLOGIEShttp://www.kaizen-news.com/wp-content/uploads/2014/02/5s-ingrediants.jpg
What is code review?Why it is needed?Who should make review?
How we can do it with tools?How we can do it in pairs?How we can do it as team?
Make peace with the simple fact that the code you’re shipping
today has bugs.
Make peace that your work is never done.
https://flic.kr/p/8ZxReChttp://www.pushing-pixels.org/2015/04/15/make-peace.html