jenkins review buddy

23
Jenkins ReviewBuddy Jenkins assisted Peer Code Reviews [email protected]

Upload: aske-olsson

Post on 10-May-2015

478 views

Category:

Technology


1 download

DESCRIPTION

Jenkins Review Buddy talk by Knud Poulsen at the Copenhagen Jenkins User Event 2013

TRANSCRIPT

Page 1: Jenkins review buddy

Jenkins ReviewBuddyJenkins assisted Peer Code [email protected]

Page 2: Jenkins review buddy

Inspiration for this talk

+ = JRB

Competitive advantage today can only be achieved through better man/machine cooperation. No huge surprise to Jenkins users.Race *with* the machine.

Page 3: Jenkins review buddy

What we’ll cover

➢ Benefits of peer code review➢ Our experiences➢ Others’ experiences➢ Real-world code review➢ Causes of noise➢ Jenkins to the rescue!➢ Demo/ Screenshots➢ Further development➢ Call for sponsors & test pilots

Page 4: Jenkins review buddy

Key Benefits of Peer Code Review

➢ 90% reduction in shipped defects often reported in industry studies

➢ 25% net productivity increase often reported in industry studies

➢ Knowledge sharing➢ Silo reduction➢ Training new employees➢ Best practice propagation

Page 5: Jenkins review buddy

Our experiences - Low Gain Example

[Anonymized and obscured]

Page 6: Jenkins review buddy

Our experiences - High Gain Example

[Anonymized and obscured]

Page 7: Jenkins review buddy

Others’ experiencesMany excellent studies out there

Page 8: Jenkins review buddy

So, what do we know ?

➢ 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. [McConnell93]

Page 9: Jenkins review buddy

So, what do we know ?

➢ Basic code reading is ~96% as effective at finding defects as holding a formal heavyweight inspection meeting [Votta1993]

➢ Technical code review checklists are a powerful help (especially against omissions) [Dunsmore2000]

➢ Defect detection drops dramatically after ~60 minutes, to zero after ~90 minutes [Dunsmore2000]

Page 10: Jenkins review buddy

So, what do we know ?

➢ The longer a reviewer spends on the initial read-through, the more defects will ultimately be found [Uwano2006]

➢ Long methods are very time consuming to understand [Uwano2006]

➢ Loops are very time consuming to understand [Uwano2006]

➢ Reading time has ~3x higher correlation with defects found than number of lines under review [Laitenberger1999]

Page 11: Jenkins review buddy

So, what do we know ?

➢ Maximum effective review rate ~400 lines per hour [Cohen2006]

➢ Disproportionately more defects are found when code changes are under 200 lines [Cohen2006]

➢ Beneficial for “quality of review” if the author pre-reviews and leaves comments for subsequent reviewers [Cohen2006]

Page 12: Jenkins review buddy

So, what do we know ?

➢ Review 100 to 300 LOC at a time, in 30-60 minutes chunks, with a break between each sitting [Cohen2006]

➢ Spend at least 5 minutes reviewing a single line of code [Cohen2006]

➢ Limit reviewing to 1 hour per day [Ganssle2009]

Page 13: Jenkins review buddy

Real world

➢ Is messy...➢ No clear pattern between time spent in the

review state, total number of reworks required, or total number of lines changed

➢ Some studies compensate by dropping unreasonable data points and assuming informal out-of-tool review

Page 14: Jenkins review buddy

Real world

Page 15: Jenkins review buddy

Why no clear pattern?

➢ “Production pressure”➢ “Lack of review guidance”➢ Hard to justify time➢ Just give up on large reviews➢ Hard to delay 1000 lines of new code the 3

days (300 lines/h, 3x1h, 1h/day) it should take to review effectively

Page 16: Jenkins review buddy

What outcome would we like?

➢ Smaller reviews should merge faster➢ Larger reviews should merge slower

Page 17: Jenkins review buddy

Race *with* the machine

➢ Guidance on time to use doing review➢ Remind author to do pre-review➢ Up-front determination of reviewers➢ Links to review checklists➢ Load balance reviewers➢ Help developers justify time investment➢ Automatically add reviewers➢ Automatically add developer as pre-reviewer

Page 18: Jenkins review buddy

Let’s try it out

Page 19: Jenkins review buddy

Let’s try it out

Page 20: Jenkins review buddy

Let’s try it out

Page 21: Jenkins review buddy

Let’s try it out

Page 22: Jenkins review buddy

Further work

➢ Also consider previous reviewers, not only previous developers

➢ Make language and domain specific review checklists easily accessible

➢ Weight and score commit message size against nr files/ lines changed

➢ Inline comments from warnings, static checkers

➢ OO review expansion, ie. “you also need to look at these 3 unchanged files”

Page 23: Jenkins review buddy

Call for Sponsors and Test Pilots

➢ Try it out in your own Gerrit Review/ Jenkins environment

➢ Sponsor development into a full-blow, feature rich, configurable “Jenkins ReviewBuddy” plugin

➢ Catch me in the break