effective code review (or how to alienate your coworkers)

Post on 17-Nov-2014

1.451 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

In this talk, the architects of Perforce Swarm will guide you through the process of starting and updating a code review. They will also share some of their secrets for performing effective reviews. Learn how to start and update code reviews using Swarm, best practices for performing effective review, and the benefits of pre-commit automated testing and deployment.

TRANSCRIPT

#

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…

##

Thank you!Geoff Nicolgnicol@perforce.com

Stewart Lordslord@perforce.com

top related