+ All Categories
Home > Software > Code Review: How And When

Code Review: How And When

Date post: 22-Feb-2017
Category:
Upload: paul-gower
View: 102 times
Download: 0 times
Share this document with a friend
70
Code Review How And When @paulmgower
Transcript

Code Review How And When

@paulmgower

I’m Paul Gower.Principal Consultant at Lunamark@paulmgower

AGENDAWhat Is Code Review1

2

3

How and When

Why Code Review

What Is Code Review

1

Father of Code Review

http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=5388086&filter%3DAND%28p_IS_Number%3A5388084%29

aka Fagan Inspections

Fagan Inspections

https://en.wikipedia.org/wiki/Fagan_inspection

Code Review History

Why Use Fagan Inspections?

Why Use Fagan Inspections?

Good for Mission Critical Software

Lightweight Code Reviews

https://en.wikipedia.org/wiki/Code_review

Over-the-shoulder

Email pass-around

Email pass-aroundPlease don’t do this!

Pair Programming

Tool-Assisted Code Review

Tool-Assisted Code Review

Tool-Assisted Code Review

Tool-Assisted Code Review

Tool-Assisted Code Review

Tool-Assisted Code Review

Tool-Assisted Code Review

Tool-Assisted Code Review

Tool-Assisted Code Review

How and When

2

Reviewer: Focus on the code

Reviewer: Focus on the code

Don’t say: “You didn’t name these variables well!”

Reviewer: Focus on the code

Don’t say: “You didn’t name these variables well!”

Instead: “I don’t understand these variable names, can you help me understand them?”

Reviewer: Be respectful

Reviewer: Find a positive point

How NOT to Code Review

Author: Be humble

Author: Prepare Before

“ “The objective is for everyone to find defects, including the author, not to

prove the work product has no defects. People exchange work products to review, with the expectation that as

authors, they will produce errors, and as reviewers, they will find errors.

Everyone ends up learning from their own mistakes and other people’s

mistakes.” – Jerry Weinberg, “The Psychology of

Computer Programming”, 1971

Tips and Tricks

Less Than 200 Lines Of Code

Less Than 60 Minutes

Less Than 60 Minutes

http://www.news.illinois.edu/news/11/0208focus_AlejandroLleras.html

Daily Code Review

Daily Code Review

http://blog.fogcreek.com/effective-code-reviews-9-tips-from-a-converted-skeptic/

Always Use A Checklist

Always Use A Checklist

http://www.codeproject.com/Articles/593751/Code-Review-Checklist-and-Guidelines-for-Csharp-De

Don’t Be This

Guy

Don’t Review What Can Be Automated

Static Code Analysis Tools

Static Code Analysis Tools

Static Code Analysis Tools

Static Code Analysis Tools

Static Code Analysis Tools

Static Code Analysis Tools

3

Why Code Review

“ “…the average defect detection rate is only 25 percent for unit testing, 35 percent for function testing, and 45 percent for integration testing.

In contrast, the average effectiveness of design and code

inspections are 55 and 60 percent.” - Steve McConnell, Code

Complete, 2004

Before 55%

Code Review Case Studies

Before

After 2%

55%

Code Review Case Studies

Before Code Reviews

After Code Reviews

Reasons to Code Review

Save Money

Easier To Find Other’s Mistakes

Alternative Implementations

Knowledge Sharing

“ “The aim is to catch what mistakes you can and to get better – not to attempt perfection.”

- Erik Dietrich, “Creating Your Code

Review Checklist”, 2015

Review

• No more than 60 mins • No more than 200 lines of code • Use Static Code Analysis • Use Check Lists • Use A Code Review Tool

THANK YOU!

@paulmgower

http://bit.ly/mcc2016-cr

lunamark.com


Recommended