testing in production
play

Testing in Production Presented by: Talia Nassi - PDF document

T3 Test Techniques Thursday, October 24th, 2019 10:15 AM Testing in Production Presented by: Talia Nassi WeWork Brought


  1. ¡ ¡ T3 ¡ Test ¡Techniques ¡ Thursday, ¡October ¡24th, ¡2019 ¡10:15 ¡AM ¡ ¡ ¡ ¡ ¡ Testing ¡in ¡Production ¡ ¡ Presented ¡by: ¡ ¡ ¡ ¡ Talia ¡Nassi ¡ ¡ WeWork ¡ ¡ Brought ¡to ¡you ¡by: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ 888 -­‑-­‑-­‑ 268 -­‑-­‑-­‑ 8770 ¡ ·√·√ ¡904 -­‑-­‑-­‑ 278 -­‑-­‑-­‑ 0524 ¡-­‑ ¡info@techwell.com ¡-­‑ ¡http://www.starcanada.techwell.com/ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

  2. Talia ¡Nassi ¡ ¡ Talia ¡Nassi ¡is ¡a ¡quality-­‑driven ¡Test ¡Engineer ¡at ¡WeWork ¡with ¡a ¡passion ¡for ¡breaking ¡ and ¡rebuilding ¡software ¡to ¡be ¡the ¡highest ¡possible ¡quality. ¡She ¡started ¡interning ¡in ¡ QA ¡when ¡she ¡was ¡studying ¡at ¡UC ¡San ¡Diego ¡and ¡immediately ¡knew ¡that ¡she ¡had ¡ found ¡her ¡calling. ¡From ¡UCSD ¡she ¡was ¡recruited ¡to ¡work ¡at ¡Visa, ¡where ¡she ¡tested ¡ the ¡payment ¡processing ¡system ¡for ¡the ¡Prepaid ¡Cards. ¡After ¡Visa, ¡Talia ¡started ¡at ¡ WeWork, ¡where ¡she ¡continues ¡to ¡innovate ¡and ¡do ¡what ¡she ¡loves—deliver ¡high ¡ quality ¡software! ¡ ¡

  3. Testing In Production Talia Nassi

  4. Think about the last feature your team deployed. Is it working? Right Now? In Production? How do you know?

  5. Testing in production is the only way to know that your features are working in production right now.

  6. What is it Testing your features in the environments where your features will live

  7. What is it not It’s not a replacement for all testing It’s not the end of the world

  8. Talia Nassi Software Engineer in Test Founder of Women Who Test Tel Aviv. Testing in prod skeptic to practitioner. My Superpowers ● Turning product requirements into test cases ● Breaking features prior to launch ● Testing my coworkers

  9. Test Environment

  10. What’s wrong with staging environments? 01. 02. 03. Staging environments are Staging test results do not Production includes data that expensive to maintain always match production test staging doesn’t have results 04. 05. No one cares if staging is The load in staging does not broken match production

  11. “ I love my staging environment ” ~No one Ever Ever.

  12. What is the first thing you do right after you deploy a feature? You go to production and test it.

  13. Testing in production only works when... 01 02 03 The whole team You test early and You trust your team owns product often and your product quality

  14. Fear.

  15. I know it’s risky. _Can affect real end users _Can affect reporting and analytics > business decisions _Can affect third parties that your software is integrated with

  16. Let me show you how We will address the to do it safely risks and set this up together

  17. 1 Install the necessary tools

  18. Feature Flagging _ It is a way to decide who sees which features _ It’s used to hide, enable, or disable the feature during run time

  19. PRODUCTION Only these These people people see the Feature Flag (users) do not changes see any changes Target Users: Tester NEW NEW Devs FEATURE FEATURE Product Design Bots

  20. PRODUCTION While the feature flag is off : _ Test requirements Feature Flag _ Open defects _ Write automation scripts Target Users: _ Verify design _ Tester NEW _ Devs FEATURE _ Validate proper _ Product functionality _ Design _ Bots

  21. PRODUCTION These people do Feature Flag not see the bugs These people see the bugs and fix them Target Users: _ Tester NEW _ Devs FEATURE _ Product _ Design _ Bots

  22. PRODUCTION Feature Flag Target Users: _ Tester NEW _ Devs FEATURE _ Product _ Design _ Bots

  23. PRODUCTION NEW FEATURE Feature Flag Everyone sees the new feature Target Users: _ Tester _ Devs _ Product _ Design _ Bots

  24. PRODUCTION Feature Flag NEW Target Users: FEATURE _ Tester _ Devs _ Product _ Design _ Bots

  25. Let’s do it in Split.io

  26. Notice the test user inside the feature flag

  27. The Code Really_Cool_Feature do something do something else

  28. The Test user.login(robot1@wework.com); this.page.goTo(www.google.com); this.page.waitFor(searchBar); ... ... ... expect(really_cool_feature).toWork();

  29. The best part?

  30. Automation Framework Why? It’s not scalable to manually test every feature in prod after you deploy it

  31. Automation Framework _ Easy to adopt _ Easy to debug _ Good reporting _ Support community

  32. Job Scheduler I will run the tests every 30 minutes for you

  33. Job Scheduler Why not just run the tests in a loop? It’s Overkill Trust your tests You can set up the tests to run in your Run them 20 times in production and build pipeline as well watch them.

  34. Alerting _ Choose an alerting tool that can be integrated with your job scheduler _ Have a rotation of who is on call to handle alerts

  35. Tools Feature flagging Automation framework Job Scheduler Alerting

  36. 2 Carefully create test data

  37. Problem We need a way to create and manipulate test data in production without affecting real end users or any data and analytics

  38. Solution Create a consistent naming convention for test users

  39. Solution Backend flagging system used to identify test entities

  40. Solution _In your automation scripts, you make sure that your test entities should only interact with each other _ We were able to create and manipulate testing entities in production by following these specific predetermined guidelines.

  41. 3 Write your tests

  42. BDD

  43. Setup & Teardown

  44. 4 Deploy to a production canary

  45. What’s a production canary? It’s when you slowly roll out a change to a small subset of users before rolling it out to the entire infrastructure to minimize impact if something goes wrong

  46. Why use a production canary? _ Canary launches provide risk mitigation _ Do you want 100% of your users to encounter the issue or 1%?

  47. Why use a production canary? _ Quickly identify the issue that might impact your entire user base _ Roll back easily to a good version _ Fix the issue in a controlled environment

  48. Production Canaries Tests Production Canary

  49. Canary Setup Split.io Netlify really_cool_feature

  50. What if there’s an issue with your canary code? Keep the canary as is and fix the bug Yes No Return the canary to 0% traffic and fix the Analyze the issue Is it ok if my users bug see this?

  51. Risk Mitigation _ Before launch, use Feature Flagging to target users _ After launch, use Production Canaries to limit audience

  52. Outcome _ Higher confidence _ Increased developer velocity

  53. OUTCOME

  54. Long term effects Tests would fail Immediately get alerted Analyze the issue right away Resolve it ASAP

  55. Long term effects Minimize user interaction with bugs and defects Ensures a great user experience

  56. Performance Testing in Production Yes, it’s possible. Do it at a time with low traffic It’s better to do it on purpose and be prepared for outages and control the outcome

  57. Testing in Production with third parties

  58. What if I can’t test in prod? _Spin up a containerized environment per build _Use docker to spin up microservices (Remember, the more dependencies, the more complicated)

  59. What about other non production tests? _ Staging environments can still be used for pre-production testing _ Very important for financial systems that abide by SOX compliance _ These should be tested ahead of time and not in production _ Privacy-related efforts should also be tested here to minimize data breaches

  60. Where do prod tests operate? All tests Basic suite of tests Unit and snapshot tests cover logic and rendering behavior End to End flows High-level verification Ensure correct behavior across all system components Smoke tests and monitoring Production Build operational confidence in tests deployed systems

  61. Shifting your company’s testing culture Explain why the pros Use examples from the past Propose a path forward outweigh the cons _Is your staging environment _ Do you remember when we merged _Have you heard about this cool thing xyz and it caused this issue in called feature flagging? Can I take unreliable? production? some time in the next sprint to see if _ Are there frequently issues that you _ Do you think if we tested xyz in we could benefit from it? think could have been caught if you production that that issue could have were testing in prod? been caught? _ If we were to start testing in _ Do you remember when we tested xyz prod,which tests do you think would inside and out in staging and then we bring us the most value? deployed to prod and it broke?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend