Post on 18-Jul-2020
transcript
1
http://smartbear.com
Review your code with Perforce and all your wildest dreams
will come true
(vote for Pedro)
http://smartbear.com
Jason Cohen
2
http://smartbear.com
http://smartbear.com
smartbear.com
3
http://smartbear.com
Code Collaborator
codecollaborator.com
http://smartbear.com
Peer Code Review +
Perforce
!=
Suck
4
http://smartbear.com
Why review code?
http://smartbear.com
Requirements
Design
Architecture
Discussion
Review
Review
5
http://smartbear.com
Requirements
Design
Architecture
Code
Discussion
Review
Review
(void)0
Where most of the bugs come from
http://smartbear.com
6
http://smartbear.com
COUNT(editors) >
COUNT(writers)
http://smartbear.com
9 errors/page
7
http://smartbear.com
Spell Czech:
Good, butt knot enough
http://smartbear.com
Find bugs
Train new hires
Cross-training
8
http://smartbear.com
if ( youLikeItSoMuch() ) { marryIt(); }
http://smartbear.com
1. Time
2. Busywork
9
http://smartbear.com
Hapless Developer
Reviewers
Perforce
http://smartbear.com
Peer Code Review +
Perforce
!=
Suck
10
http://smartbear.com
Review Method #1:
Over-the-shoulder
http://smartbear.com
Over-the-Shoulder
11
http://smartbear.com
Over-the-Shoulder
http://smartbear.com
Over-the-Shoulder
12
http://smartbear.com
Walk through the diffs
http://smartbear.com
Post-its: Airtight issue-tracking system
13
http://smartbear.com
Over-the-Shoulder
Easy, Free
Interruption
No info
Walk-through
http://smartbear.com
Review Method #2:
Meetings
14
http://smartbear.com
Schedule it
http://smartbear.com
Walk through the diffs
15
http://smartbear.com
Print-outs are soooo 1976
http://smartbear.com
Formal Inspections
Michael Fagan, IBM, 1976
16
http://smartbear.com
1. Planning 2. Intro 3. Reading
4. Inspect 5. Rework 6. Verify
7. Complete 8. Improve
Fagan’s Phases
= Meeting
http://smartbear.com
Meetings are required. —Michael Fagan, ‘76
17
http://smartbear.com
Meetings are required. —Gilb, Fagan, Wiegers
http://smartbear.com
You didn’t check for null. —The Phantom Inspector
18
http://smartbear.com
Are meetings worth it? —Lawrence Votta, ‘93
http://smartbear.com
4%
19
http://smartbear.com
Review Method #3:
http://smartbear.com
Submit Changelist
20
http://smartbear.com
Get Email notification
http://smartbear.com
Look at diffs
21
http://smartbear.com
Talk over email
http://smartbear.com
Review Daemon
System Administrator’s Guide Chapter 6
(near the end)
Server-side Configuration
22
http://smartbear.com
Reviews: //depot/main/... //depot/.../README //depot/jobs
Subscribe via User Spec (p4 user)
http://smartbear.com
Python is just as scared of you as you are of it.
p4review.py
23
http://smartbear.com
Easy, Free
No interruption, remote
Conversation-tracking
No info / No end
“I thought you had it.”
http://smartbear.com
Review Method #4:
Tool-Assisted
24
http://smartbear.com
Tools
Code Collaborator Commercial
Crucible Commercial
Review Board Open-Source
Mondrian Internal
http://smartbear.com
Alleged Benefits
Reality
Tools
25
http://smartbear.com
Hapless Developer
Reviewers
Perforce
Identify Changes
Package/Deliver
Organize Communication
Track Defects Audit Trail
Reports Automatic Metrics
http://smartbear.com
Best Practices How to not waste time
26
http://smartbear.com
Cisco® MeetingPlace® Case Study
3,200,000 lines of code
2,500 reviews
50 developers
10 months
San Diego, Bangalore, Budapest
http://smartbear.com
It’s in the handbook
27
http://smartbear.com
60-90 minutes max
Time (minutes)
Def
ects
Fou
nd
http://smartbear.com
When to review?
Pre-commit blocks development
Post-commit harder to fix bugs
Pre-commit is less workflow
Pre-commit protects others
28
http://smartbear.com
Checklists
http://smartbear.com
Checklist for Checklists
7 ± 2 (George Miller, ’52)
No obvious stuff
Nothing that can be automated
Stuff that’s easy to forget
EXAMPLE: Errors handled properly everywhere in method
29
http://smartbear.com
(Re)building a checklist
The Week of Pain
http://smartbear.com
Getting Started
30
http://smartbear.com
Selected Code
Stable branch
Core module
Top 10 scariest files
http://smartbear.com
Unit tests only
31
http://smartbear.com
During feature-freeze
http://smartbear.com
You know what to do, and you know when to do it.
<beeep!>
32
http://smartbear.com
Gotta Wanna
http://smartbear.com
Thank You.
Code Collaborator (product placement? you rogue!)
http://codecollab.com http://blog.smartbear.com Twitter: @smartbears
Jason Cohen jason@smartbear.com http://blog.asmartbear.com