Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Testing in Production: Dangerous, scary or better?

Testing in Production: Dangerous, scary or better?

Slides from Test Bash Belfast 2017

JonHW

May 23, 2017
Tweet

More Decks by JonHW

Other Decks in Technology

Transcript

  1. @jonhw87 2 Testing in Production: Dangerous, scary or better w

    • What is it? • Why? • What are the challenges? • Taking it further - an example • Lessons learnt
  2. @jonhw87 3 Testing in Production: Dangerous, scary or better Traditional

    flow Develop Test Deploy Check LOCAL Test / staging PRODUCTION ???
  3. @jonhw87 5 Testing in Production: Dangerous, scary or better w

    Test environments allow us to: • Test before live • Make a mess… • And not clear it up • Have total control
  4. @jonhw87 6 Testing in Production: Dangerous, scary or better w

    Test environments can also be: • Maintenance heavy • Lower priority than prod • Isolated • Inaccurate
  5. @jonhw87 7 Testing in Production: Dangerous, scary or better Traditional

    flow Develop Test Deploy Check LOCAL Test / staging PRODUCTION ???
  6. @jonhw87 8 Testing in Production: Dangerous, scary or better w

    Monitoring What it can What it can’t API / HTTP responses Integrated user journey Machine status Traffic levels Crash reporting
  7. @jonhw87 9 Testing in Production: Dangerous, scary or better w

    Rob Ewaschuk: ‘Do your users care if your MySQL servers are down? No, they care if their queries are failing’ https://docs.google.com/document/d/1XrXehEJ27vQLqsIpm8b5Wgtxd1Xv262t1Ywu6HBTcfg/
  8. @jonhw87 12 Testing in Production: Dangerous, scary or better w

    Fears for testing in production: • What if users notice? ◦ Something broke! ◦ A test while it’s running ◦ Test data ◦ Test residue ◦ Other evidence of test activity
  9. @jonhw87 15 Testing in Production: Dangerous, scary or better w

    In the pipeline…but in production • When a test environment is not: ◦ Possible ◦ Practical ◦ Affordable • Keep it hidden = keep your release hidden? • Requires fast recovery
  10. @jonhw87 16 Testing in Production: Dangerous, scary or better w

    …or as monitoring (synthetic monitoring)
  11. @jonhw87 17 Testing in Production: Dangerous, scary or better w

    The tests: • Create a piece of content • Follow it through the entire stack • Take down the content • Confirm through the stack
  12. @jonhw87 18 Testing in Production: Dangerous, scary or better w

    The challenges: • Hiding test content • Continual running • The tests • Visibility of results
  13. @jonhw87 19 Testing in Production: Dangerous, scary or better w

    Hiding test content… ...in more places than you think
  14. @jonhw87 23 Testing in Production: Dangerous, scary or better w

    Continuous running… ...and unexpected outcomes
  15. @jonhw87 25 Testing in Production: Dangerous, scary or better w

    Example CI tests: 15 runs per day / 95% accuracy = <4 failures per week
  16. @jonhw87 26 Testing in Production: Dangerous, scary or better w

    Synthetic monitoring tests: 3,000 runs per day / 95% accuracy = 150 failures per day
  17. @jonhw87 28 Testing in Production: Dangerous, scary or better w

    Better webdriver... • Assert on the API / Data • Everything conditional • No unnecessary UI actions
  18. @jonhw87 29 Testing in Production: Dangerous, scary or better w

    Accuracy…. ...more accuracy…. ...and tolerance
  19. @jonhw87 31 Testing in Production: Dangerous, scary or better w

    CI tests: Commit / merge Test Release Fix
  20. @jonhw87 32 Testing in Production: Dangerous, scary or better w

    Synthetic monitoring tests: Continuous test
  21. @jonhw87 35 Testing in Production: Dangerous, scary or better w

    Benefits: • Better awareness • Accurate alerting • Easier & faster investigation • Use beyond the team
  22. @jonhw87 36 Testing in Production: Dangerous, scary or better w

    Lessons learnt • Not scary • Not dangerous • Better?