clean all the things: encouraging clean code in big teams

24
ZILLOW | TRULIA | STREETEASY | HOTPADS

Upload: new-relic

Post on 16-Apr-2017

1.068 views

Category:

Data & Analytics


0 download

TRANSCRIPT

Page 1: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Page 2: Clean All the Things: Encouraging Clean Code in Big Teams

CLEAN ALL THE THINGS!ENCOURAGING CLEAN CODE IN BIG TEAMS

Dave Rochwerger, Engineering Director, Agent Platform @catchdave

ZILLOW | TRULIA | STREETEASY | HOTPADS

Page 3: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Zillow Group

• Culture is paramount

• Many teams, many offices (SF office > 200 engineers)

• Up to 100 engineers contribute to a repository

• Many products, release cycles & techs

Page 4: Clean All the Things: Encouraging Clean Code in Big Teams

Clean Code

Page 5: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Clean Code

• Low defects

• Maintainable

• Testable

Page 6: Clean All the Things: Encouraging Clean Code in Big Teams

Clean code in large companies?

Page 7: Clean All the Things: Encouraging Clean Code in Big Teams
Page 8: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

2014: The Bad

• Too many bugs

• Highly coupled, low communication teams

• Preventable mistakes (code quality & releasing)

• Inconsistent testing knowledge & usage

Page 9: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

2014: The Good

• Company-wide training

• Code quality guidelines

• IDE plugins

• Git hooks

• Post-merge CI jobs

Page 10: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Page 11: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Mr. CleanEncouraging high code quality

Page 12: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Mr. Clean Goals1. Push defect detection as early as possible

2. Make it difficult to contribute bad code

3. Make it easy to contribute good code

• Automate away easy things

• Code review focus should be subjective

Design' Coding' QA' Post/release'

Effort'

Page 13: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

“Culture eats strategy for breakfast”

Page 14: Clean All the Things: Encouraging Clean Code in Big Teams
Page 15: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Blocks Merging

Page 16: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Stash Integration

Page 17: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Jenkins Integration

Page 18: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Approach• Lots of testing

• Kept goals in sight

• Iterate, iterate, iterate

• Garner constant feedback

• Stealth deployment (nothing like testing in prod)

• Communicate, communicate, communicate

Page 19: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Results (so far)

• 15,000 PRs examined since May

• Bugs were found on day 1

• Test suites 100% usable

• Many “saved my life” anecdotes

Page 20: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Results (so far)

Bugs per week down 30%

0"

2"

4"

6"

8"

10"

12"

14"

16"

18"

20"

1" 2" 3" 4" 5" 6" 7" 8" 9" 10" 11" 12" 13" 14" 15" 16" 17" 18" 19" 20" 21" 22" 23" 24" 25" 26" 27" 28" 29" 30" 31" 32" 33" 34" 35" 36" 37" 38" 39" 40" 41" 42" 43" 44"

Bugs%fo

und%

Week%Number,%2015%

Team%A%Bugs%

Team"A" Expon."(Team"A)"

Mr."Clean""

Page 21: Clean All the Things: Encouraging Clean Code in Big Teams

The Future

Page 22: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Insights Reporting

Page 23: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Take-aways

• Clean code is important

• Clean code is harder in large teams

• Fostering the right culture is key

• Spread the word about your great work!

Page 24: Clean All the Things: Encouraging Clean Code in Big Teams

ZILLOW | TRULIA | STREETEASY | HOTPADS

Questions?

Dave Rochwerger @catchdave

ZILLOW | TRULIA | STREETEASY | HOTPADS