How to submit better pull requests

Kevin Burke

What I'm not talking about

Caveat emptor

How many errors are there to be found?

Probably around 1-25 per 1000 lines of code

What kinds of errors?

How many can we expect to find?

If you do it well: 70%

If you do it poorly: 20%

Effectiveness of different bug-finding tools

How are errors distributed?

In general, 80% of the errors come from 20% of the code.
Also, 50% of errors from 5% of the code

Case study at IBM: 31 of 425 classes found to be error-prone. After repair/refactoring, defects reported by customers were reduced by 1000%

Pull request length

Example

Longer pull requests take longer to get reviewed/merged (why?)

How quickly can you do code review?

Estimates: 500 lines/hour for "application" code
125 lines/hour for "system" code
Attention span/effectiveness drops after 2 hours of review
Start at 200 lines/hour

Advice

Kevin Track

Spreadsheet with errors

Git pre-commit hooks


              ,
          ,   |\ ,__
          |\   \/   `.
          \ `-.:.     `\
           `-.__ `\=====|
              /=`'/   ^_\
            .'   /\   .=)
         .-'  .'|  '-(/_|
       .'  __(  \  .'`
      /_.'`  `.  |`
               \ |
                |/
								
source

Thanks!

Kevin Burke

kev.inburke.com

kevin@twilio.com

@derivativeburke


These slides are available at:

kev.inburke.com/slides/pull-requests

/

#