Slide 1

Slide 1 text

Test in DevOps

Slide 2

Slide 2 text

Disclaimer: This presentation is to share concepts described in this awesome book for a internal study group and most materials are originated from it. You can find the book [here].

Slide 3

Slide 3 text

BACKGROUND

Slide 4

Slide 4 text

• Sole ownership of test strategy and execution • Thinking up our own test ideas • Exploring the SW independently Waterfall

Slide 5

Slide 5 text

• Testing is an activity own by whole development team • Discuss requirement with DEV & BA thru BDD collaboratively • Acceptance testing in development process • Fast feedback by iterative release with pre-release checks • It changes the scope and pace of testing Agile

Slide 6

Slide 6 text

• Team manages SW lifecycle: operation infra and monitoring, customer support and analytics • Test in production-like env: docker, k8s • Rapid customer feed back from metrics, beta testing groups, A/B testing • Real-time monitoring dashboards DevOps

Slide 7

Slide 7 text

• Fostering collaborative culture to achieve rapid and reliable release • Testers struggle to find balance of new feature exploring without slowing down the release • Automation is really a solution to this ?? DevOps is Speed

Slide 8

Slide 8 text

DevOps is a term used to refer to a set of practices that emphasizes the collaboration and communication of both software developers and other information-technology (IT) professionals while automating the process of software delivery and infrastructure changes. It aims at establishing a culture and environment where building, testing, and releasing software can happen rapidly, frequently, and more reliably. Definition of DevOps

Slide 9

Slide 9 text

• Focus on developer and operations • Testing is absence from the the term • Testing is a pervasive activity throughout development (like the air) DevOps and Testing image: Dan Ashby [https://danashby.co.uk/2016/10/19/continuous- testing- in- devops/]

Slide 10

Slide 10 text

• What exactly is your responsibility? • How should you try to contribute? • Still benefit in distinguishing testing tasks from other types of work? • What weighting should you give to testing? Beyond the Testing Role Q: The difficulty for testers is identifying what their role is, when testing is expected to be a part of everything.

Slide 11

Slide 11 text

TESTING IN A DEVOPS CULTURE

Slide 12

Slide 12 text

Test Strategy Retrospective

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

Collaboration Beyond Development

Slide 15

Slide 15 text

TESTING IN DEVELOPMENT

Slide 16

Slide 16 text

• Unit test, integration tests, e2e tests (confirm behaviour) • Non-Functional behaviors: accessibility, security and performance • But no deep or thoughtful insight provided from these tests Feedback in Development - Automation

Slide 17

Slide 17 text

• Searching for the unknowns • Adopting different personas • …… • Generate ideas, process results, and form opinions Feedback in Development - Exploration image: https://findingdeefex.com/2016/05/20/the-testing-checking-synergy/

Slide 18

Slide 18 text

What we do in DevOps (shift right) • Testing in production: A/B testing, beta testing, monitoring as testing • Use feature toggles • People who perform testing will grow: bug bashes, crowd testing Test Practices in Development

Slide 19

Slide 19 text

Test Practices in Dev - Deployment Pipelines Before (dedicated env): After (cloud env):

Slide 20

Slide 20 text

Think about how your pipeline might fail: • What if pipeline fails between steps / commands, any impact? • Test how to recover/rollback of sth went wrong? • Be more careful if steps target the production How do You Test a Pipeline

Slide 21

Slide 21 text

Test Practices in Dev - Feature Toggles

Slide 22

Slide 22 text

Test Practices in Dev - Feature Toggles

Slide 23

Slide 23 text

Questions: • switch the toggle off -> safety net -> but how do users feel if premium features disappear? • Can I easily determine current toggle status and audit information • Are there active toggles that should be removed? • is the toggle needed at all? Test Practices in Dev - Feature Toggles

Slide 24

Slide 24 text

A bug bash is an activity where all the people involved in the delivery of software put aside their usual work and participate in a dedicated testing session. Test Practices in Dev - Bug Bash

Slide 25

Slide 25 text

Questions: If the team are releasing multiple times per day there may not be a window of opportunity to explore a fixed release, still value to bug bash? Test Practices in Dev - Bug Bash

Slide 26

Slide 26 text

TESTING IN PRODUCTION

Slide 27

Slide 27 text

Testing monitoring and alerting • When configuring a new monitor, ideally you will test that it works by causing an issue that the monitor should detect. • If you have configured a monitor that generates an alert, you may wish to test that the alert is delivered successfully. Feedback in Production - Monitoring and alerting

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

What is Analytics? • In a web application: page views • In a telephone network: call durations • In a banking product: transaction volumes Feedback in Production - Analytics Events (Data) Organizations collect all sorts of data to learn about their users’ behaviour and respond to it. Be mindful of what is recorded, and work closely with the analytics team to determine what’s most appropriate to track.

Slide 31

Slide 31 text

Testing analytics: Testing of analytics will generally focus on the design of information rather than the specific behaviour of individual pieces of data. Ex: should you record ‘quick transfer’ and ‘payments’ actions as separate events? Should you record web and mobile actions separately? Beta and A/B experiments are supported by analytics information. Fast feedback may appear through monitoring, but it is often through deeper analysis of analytics data that final decisions are made. Feedback in Production - Analytics Events (Data)

Slide 32

Slide 32 text

Developer consider • What type of information are valuable to log • How to categorize messages to: errors, warning, info and debug Testing logging A bug in development can be a good opportunity to test log files. Any problems should create appropriate log messages. Feedback in Production - Logging

Slide 33

Slide 33 text

Given I run a scenario as a Lawyer And I create a document [And I wait 5 seconds] When I search the logs API Then I should find a recent entry for “AuditRecordCreated” Feedback in Production - Logging

Slide 34

Slide 34 text

Test practices in production • Traditional development: testing in production after a large release, rarely generates new work • In DevOps: testing in production continuously providing feedback that shapes future iterations Test Practices in Production

Slide 35

Slide 35 text

Testing and monitoring have traditionally served different purposes. Monitoring as testing blurs these differences, pulling ideas from testing into creating and testing monitors. Instead of waiting passively for a user to interact with a feature, run test automation to generate events in production. You may discover and resolve a bug in production before a user experiences it. Passive validation gives insight into how users behave, by monitoring information for real interactions. Active validation will generate observable data by executing known repeatable scenarios. Test Practices in Production - Monitoring as Testing

Slide 36

Slide 36 text

• Canary release • Staged rollout • Dogfooding • Dark Launching Testing in Production - Exposure Control

Slide 37

Slide 37 text

TESTING IN DEVOPS ENVIRONMENTS

Slide 38

Slide 38 text

Platform evolution (container-based, cloud) Infrastructure as code • VM, OS version, network topology • Vagrant, Terraform • Version controlled Configuration management • Puppet, Chef, Ansible, SaltStack … • Handles complexity of configuring distributed infrastructure resources Container • …… Testing in DevOps Environments [Note] ex: dev can run MySQL, server app on local desktop

Slide 39

Slide 39 text

Platform evolution (container- based, cloud) Cloud • …… Testing in DevOps Environments [Note] ex: dev can run MySQL, server app on local desktop

Slide 40

Slide 40 text

Testing Practices for Environments

Slide 41

Slide 41 text

• Servers are a commodity • Test automation can provision a fresh environment • Reduce “it works on my machine” • More environments (beta, staging, production) have a negative impact - Different versions deployed in diff environments - Data integrity problem - Remember that production env is the ultimate destination Testing Practices - Environments Management

Slide 42

Slide 42 text

Testing Practices - Environments Management

Slide 43

Slide 43 text

When infrastructure becomes code : • Static analysis, unit tests, and acceptance tests can all be applied to infrastructure. • Test Kitchen is a tool for automated testing of configuration management code. Testing Practices - Infrastructure Testing Once environments are no longer precious, destructive testing becomes easier: • Kill a network interface • Stop database processes • Flood a web services port • Restart the environment unexpectedly Testing Practices - Destructive Testing

Slide 44

Slide 44 text

Testing Practices - Destructive Testing

Slide 45

Slide 45 text

INDUSTRY EXAMPLES

Slide 46

Slide 46 text

The Guardian - Testing in Production (2016)

Slide 47

Slide 47 text

Etsy track everything: “number of logins, number of login errors, dollars of transactions through the site, bugs reported on the forum – you name it” Etsy - Monitoring as Testing

Slide 48

Slide 48 text

TEST STRATEGY IN DEVOPS

Slide 49

Slide 49 text

Test Strategy in DevOps

Slide 50

Slide 50 text

TestOps environment, how day-to-day work of a tester might change: 1. The tester moves away from up-front testing and execution of functional test cases. This responsibility shifts towards the developer who “must use every available means to produce code free of low context bugs that can be found by running on his desktop” 2. The tester creates tools that can run tests in the production environment, which may look a lot like monitors. “The value test brings is in moving these monitors from heartbeats and simple scenarios to high context user affecting scenarios” Testing vs Tester

Slide 51

Slide 51 text

How DevOps is Killing QA – Asaf Yigal “In the end, if there is a layer of people in the middle between development and operations, then you cannot perform CI and CD seamlessly and, therefore, cannot do DevOps. To run a proper DevOps operation, you cannot have QA at all.” Testing vs Tester

Slide 52

Slide 52 text

DevOps presents a lot of opportunities to think differently about testing. Creating connections between the development and operations teams can influence test coverage, test strategy, and even the infrastructure where testing occurs. The degree of change in your organization will depend on the business drivers for DevOps and the appetite for risk. Conclusion

Slide 53

Slide 53 text

[Introduced in this book:] Test Strategy Retrospective workshop Risk workshop A structure way while paring Workshops & Collaboration

Slide 54

Slide 54 text

Q & A

Slide 55

Slide 55 text

source from: https://www.slideshare.net/noahsussman/continuous-improvement-devops-day-mountain-view-2012

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content