1 of 45

Move Fast & Don't Break Things

Ankit Mehta, Google

2 of 45

Ankit Mehta, Google

Move Fast & Don’t Break Things

GTAC 2014

3 of 45

Why am I talking @ GTAC

  • Sharing my experience of a decade @ Google in Test Engineering
  • Passionate about balance between velocity and quality
  • Taking an opportunity to share Google’s take at balancing velocity and quality

Interesting side projects @ Google:

MAD (Millions of Automated Documents)

Scale Google’s Bug database

Surveytool

Microprocessor controlled pick n place manipulator (school)

Move Fast & Don’t Break Things

4 of 45

Test Engineering

“what is our purpose?”

Move Fast & Don’t Break Things

Build world class infrastructure to launch high quality innovative products fast that delight our users

5 of 45

Google from the outside..

Move Fast & Don’t Break Things

6 of 45

Google from the inside…

Move Fast & Don’t Break Things

7 of 45

More code

  • 30K check-ins per day
  • A check-in every 3s!

Move Fast & Don’t Break Things

8 of 45

More releases

  • 2x more releases

Move Fast & Don’t Break Things

9 of 45

State of releases

  • Releases have long cycles; hence everyone wants in
  • Lack of discipline/time pressure leads to regressions and further delays
  • No way to isolate issue and hence further delay and work around it

Move Fast & Don’t Break Things

10 of 45

Moving Fast is Good!

  • Innovate
  • Address flaws quickly
  • Better productivity
  • Better Code Health

Move Fast & Don’t Break Things

11 of 45

… But Breaking things isn’t

  • User trust/satisfaction
  • Uphold the brand
  • Launch products
  • Set a high bar

Move Fast & Don’t Break Things

12 of 45

My Testing Philosophy

What many teams do

How it should be done

Move Fast & Don’t Break Things

Maintenance

Slower tests

Flakiness

13 of 45

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

14 of 45

Push on Amber

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

15 of 45

Push on Green..

“As soon as test suites go green, deployment to production is automatically started”

This has evolved at Google. We have tens of thousands of tests for some projects, some of which could be failing and/or flaky

Move Fast & Don’t Break Things

16 of 45

Push on Amber

  • Daily pushes to prod
  • Stable top of tree
  • Smarter regression testing
  • Critical tests cannot be bypassed

Move Fast & Don’t Break Things

17 of 45

Prevent Bugs

Push on Amber

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

18 of 45

Prevent Bugs

  • Prevent bugs and not catch them
  • Deterministic hermetic tests
  • Prevent bad code from getting in
  • High presubmit coverage and usage

Move Fast & Don’t Break Things

19 of 45

What is a Hermetic Test?

The short definition would be a “test in a box”.

My version: run a test while on a airplane *without network

Move Fast & Don’t Break Things

20 of 45

Non-Hermetic Servers

Before

Move Fast & Don’t Break Things

21 of 45

Hermetic Servers

After

Move Fast & Don’t Break Things

22 of 45

Prevent Bugs

Push on Amber

Push Testing upstream

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

23 of 45

Pushing Testing Upstream

Move Fast & Don’t Break Things

24 of 45

Prevent Bugs

Push on Amber

Push Testing upstream

Delineate product releases and features

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

25 of 45

Delineate product releases and features

  • Releases always keep rolling
  • Dark launch features
  • Revert features and not revert releases
  • Launch releases without leaking features

Move Fast & Don’t Break Things

26 of 45

Prevent Bugs

Push on Amber

Push Testing upstream

Productivity First

Delineate product releases and features

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

27 of 45

Productivity First..

  • Invisible Tests
  • Tests an asset and not a liability
  • Fast UI Automation
  • Zero tolerance on flakiness

Move Fast & Don’t Break Things

28 of 45

Attack Bad Tests

  • Slow Tests
  • Flaky Tests

Move Fast & Don’t Break Things

29 of 45

Flaky tests are worse than no tests

Move Fast & Don’t Break Things

30 of 45

Robosheriff

Move Fast & Don’t Break Things

31 of 45

Social @ Google

2012

2013

2014

Assessment

Average presubmit time

21 min

28 min

22 min

Productivity

Code Coverage

???

72.80%

75.60%

Automation

% Green Cycles

71.40%

82.40%

89.60%

Test Hygiene

Avg Submit to Prod Time

17 hrs

11 hrs

13 hrs

Velocity

Total presubmit run time

196 d

11392 d

8033 d

Better Tests

Total automation time

22697 d

52785 d

114040 d

Better Tests

P1 bugs avg resolution time

69 d

28 d

13 d

Bug Hygiene

32 of 45

Prevent Bugs

Push on Amber

Push Testing upstream

Productivity First

Fishfood

Delineate product releases and features

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

33 of 45

Fishfood

  • Live on the bleeding edge
  • Bugs get found/fixed
  • No SLA for fishfood from test
  • Rapid iterations. 4 hours from design to bug bash for a feature.

Move Fast & Don’t Break Things

34 of 45

Prevent Bugs

Push on Amber

Push Testing upstream

Productivity First

Fishfood

Prioritize Releases

Delineate product releases and features

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

35 of 45

Prioritize Releases

  • Must be an ongoing commitment
  • All must want to fix root problems (post-mortem!)
  • Have a dedicated release team
  • Make sure everyone understands it

Move Fast & Don’t Break Things

36 of 45

Prevent Bugs

Push on Amber

Push Testing upstream

Productivity First

Fishfood

Prioritize Releases

Treat Regressions as build blockers

Delineate product releases and features

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

37 of 45

Treat regressions as build breaks

Cultural shift

Rollback == guaranteed fix

Verifications are simpler

Devs not under gun for fix

Move Fast & Don’t Break Things

38 of 45

Prevent Bugs

Push on Amber

Push Testing upstream

Productivity First

Fishfood

Prioritize Releases

Treat Regressions as build blockers

Remember Murphy’s Law

Delineate product releases and features

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

39 of 45

Remember Murphy’s Law

  • Kill switches for features
  • Big refactorings behind flags
  • All user visible changes behind experiments

Move Fast & Don’t Break Things

40 of 45

Prevent Bugs

Push on Amber

Push Testing upstream

Productivity First

Fishfood

Prioritize Releases

Treat Regressions as build blockers

Remember Murphy’s Law

Delineate product releases and features

Balance Velocity vs Quality

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

41 of 45

Balance Velocity vs Quality

  • Gate keepers
  • Provide risk assessment
  • Trusted Testers
  • Things that can’t be risked with: ACLs, data, security, upgrades, migrations

Move Fast & Don’t Break Things

42 of 45

Prevent Bugs

Push on Amber

Push Testing upstream

Productivity First

Fishfood

Prioritize Releases

Treat Regressions as build blockers

Remember Murphy’s Law

Delineate product releases and features

Balance Velocity vs Quality

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

43 of 45

It’s no secret mobile is taking over.

PCS

SMARTPHONES & TABLETS

Move Fast & Don’t Break Things

44 of 45

“Mobile First” Challenges

  • Balance release velocity - can’t push daily to users.
  • Mobile app updates use battery and cellular data.
  • Cannot roll back a bad mobile app easily; higher quality bar needed.

Come join the discussion @ “Move Fast & Don’t Break Things” G+ Community

Move Fast & Don’t Break Things

45 of 45

Prevent Bugs

Push on Amber

Push Testing Upstream

Productivity First

Fishfood

Prioritize Releases

Treat Regressions as build blockers

Remember Murphy’s Law

Delineate product releases and features

Balance Velocity vs Quality

Move Fast & Don’t Break Things

Move Fast & Don’t Break Things

Cultural

Cultural + Tooling

Tooling