Slide 1

Slide 1 text

Code Review

Slide 2

Slide 2 text

Josh Betz Engineer, Automattic

Slide 3

Slide 3 text

Why Code Review?

Slide 4

Slide 4 text

• More than 2.6 billion monthly page views • More than 9.5 million lines of code • 100% uptime last 30 days

Slide 5

Slide 5 text

Another set of eyes on your code.

Slide 6

Slide 6 text

Be proactive • Fix issues before they make it to production • Limit downtime • Don’t get hacked

Slide 7

Slide 7 text

Save $$ • Downed, broken, hacked sites are expensive. • Expensive to debug • Expensive to fix

Slide 8

Slide 8 text

Become a better programmer • Part of the WordPress culture is learning by example. • All code that goes into core starts as a patch on a trac ticket. • You can learn just as much by giving feedback as you can by receiving feedback.

Slide 9

Slide 9 text

You wouldn't publish a book without sending it to an editor first, don't publish software without code review.

Slide 10

Slide 10 text

What is Code Review?

Slide 11

Slide 11 text

What do we look for?

Slide 12

Slide 12 text

Security • XSS • SQL Injection • …

Slide 13

Slide 13 text

Performance • Slow Queries • Self DoS • Uncached functions

Slide 14

Slide 14 text

Functionality “Does this do what it’s supposed to do?”

Slide 15

Slide 15 text

When do you Code Review?

Slide 16

Slide 16 text

Always before production.

Slide 17

Slide 17 text

Before staging, if possible.

Slide 18

Slide 18 text

Methods of Code Review

Slide 19

Slide 19 text

Line-by-line • Important: Feedback references the code, not the developer. • Have a Checklist • Github Pull Requests • Feature Branch Workflow • Gitflow Workflow

Slide 20

Slide 20 text

Pair Programming

Slide 21

Slide 21 text

Automated

Slide 22

Slide 22 text

Unit Tests

Slide 23

Slide 23 text

Static Analysis • VIP Scanner • PHP Codesniffer • Services like Code Climate

Slide 24

Slide 24 text

Mix

Slide 25

Slide 25 text

What do you do?

Slide 26

Slide 26 text

Come work with me! http://automattic.com/work-with-us/