Date post: | 17-Nov-2014 |
Category: |
Technology |
Upload: | perforce |
View: | 1,450 times |
Download: | 1 times |
#
Effective Code Review (Or How To Alienate Your Coworkers)
Geoff NicolSecurity Architect
Stewart LordPrincipal Architect
#
Geoff NicolPerforce Software
Stewart LordPerforce Software
#
1. Why do Code Review?2. Our Philosophy3. The 3 Key Steps4. Bonus Round!5. Questions
Overview
#
Why Do Code Review?
#
• Bugs happen• Hard to fix when shipped• Builds a stronger team• Bottom line: cheap, good and fast!
Why Do Code Review?
#
• JPL estimates $25,000 saved per inspection• 55-60% defect detection rate• 14% more productivity, 90% fewer defects
Source: Code Complete by Steve McConnell
Why Do Code Review?
#
Our Philosophy
#
"Optimize user happiness to lines of code ratio"- Thomas Fuchs
• Quality before commit• Best UX possible• Learn from each other
Philosophy
#
The 3 Key Steps
#
1. Step away from the code2. Don’t look at the code3. Stare deeply into the code
The 3 Key Steps
#
• Do we know enough?• Is it too big?• Side effects?• Roadmap?• Release cycle?
1. Step Away
#
• Start with UX• Can UX be simplified?• Does it look good?• Look at API• Look at the context
2. Don’t Look
#
• Inspect line by line• Simplify, simplify, simplify• Consider edge cases• Put your evil hat on
3. Stare Deeply (Logic)
#
• Balance for readability• Ensure code is well commented• Would a var by any other name smell as sweet?
3. Stare Deeply (Finesse)
#
Bonus Round!
#
• Ensure code has tests• Integrate tests with reviews• Integrate staging with reviews• Pair programming• Look at contributor guidelines
Much Bonus, So Round!
#
• Check your ego• Ask why• Iterate• Try try again• GIFs, Emojis, Memes, Youtube
With Coworkers Like These…