why automated testing matters to devops

31
Automated Testing is a Pain in My ____ Paul Merrill @dpaulmerrill [email protected] beaufortfairmont.com

Upload: dpaulmerrill

Post on 14-Apr-2017

636 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Why Automated Testing Matters To DevOps

Automated Testing is a Pain in My ____

Paul Merrill@dpaulmerrill

[email protected]

Page 2: Why Automated Testing Matters To DevOps

What is your worst experience with automated testing?

Page 3: Why Automated Testing Matters To DevOps

What is automated testing?

Page 4: Why Automated Testing Matters To DevOps

Automated Testing:

A process that stimulates a system&

reports whether expectations are met

Page 5: Why Automated Testing Matters To DevOps

Types of Automated Testing

Page 6: Why Automated Testing Matters To DevOps

Unit Tests

• Written by developers• Intimate with code under test• ONLY interact with unit under test • Mock everything else• May influence design• May expose design concerns• Run FAST (hundreds in secs on dev machine)

Page 7: Why Automated Testing Matters To DevOps

Unit Tests

Unit

Test

Test

Mock

Mock

Page 8: Why Automated Testing Matters To DevOps

Integration Tests

• Intimate with code under test• May or may not interact with other systems• May use mocks, simulators, scaffolding• May influence design• May expose separation of concerns• May or may not run on Dev machines• May be fast or slow• May or may not encapsulate a user function

Page 9: Why Automated Testing Matters To DevOps

Integration TestsSystem Under Test (SUT)

Component A

Component C Component D

Component B

Page 10: Why Automated Testing Matters To DevOps

Integration Tests - Example 1System Under Test (SUT)

Reporting Service

Authentication Broker

Parsing Service

Page 11: Why Automated Testing Matters To DevOps

Integration Tests - Example 2System Under Test (SUT)

Restful Server

User Interface

Database

Request

Page 12: Why Automated Testing Matters To DevOps

End to End (E2E) Tests

• Interacts with System as an “Actor” would• Assumes similar environment to production• May or may not run on Dev machines• Hopefully fast, usually slow (minutes & hours)

Page 13: Why Automated Testing Matters To DevOps

End to End (E2E) Tests

Page 14: Why Automated Testing Matters To DevOps

What does bad automated testing look like?

Page 15: Why Automated Testing Matters To DevOps

Bad Automated Testing

Causes unexpected work, like…– “You filled up the disk”– “The network was flooded”– Data leaks– Tests fail because of poor design– Cascading failures– Numerous false positives– Inconsistent results

Page 16: Why Automated Testing Matters To DevOps

What does good automated testing accomplish, how is it different?

Page 17: Why Automated Testing Matters To DevOps

Good Automated Tests…Expedite work, like…• “The tests showed me where to look”• Expose error states

– java.lang.StackOverflowError (bad recursion)• High signal-to-noise ratio

– No cascading, except in serious cases– Few false positives

• Act as or establish a “Source of Truth”– Tests fail here, but not there– Tests fail with this data, but not that data

• Isolate problem scope

Page 18: Why Automated Testing Matters To DevOps

Good Automated Tests…

Smooth edges via friction

Friction:• Failing tests• Failing systems• Identifying system limits• Forcing consideration of constraints, scenarios, cases

Smoothed:• Pronounce or expose implied contracts

Page 19: Why Automated Testing Matters To DevOps

How does this affect you?

Page 20: Why Automated Testing Matters To DevOps

Follow the Value

• Your role is, was, or is projected to be valuable to someone somewhere

• Someone has decided:– Consumers won’t buy without your role OR– To speculate that value is increased by your role

Page 21: Why Automated Testing Matters To DevOps

Passing the Value

The person who understands your value may not be the person who makes decisions

Or

The person who understands your value may not communicate it in a way that benefits you

Page 22: Why Automated Testing Matters To DevOps

If your value is obscured…

You go home!

Page 23: Why Automated Testing Matters To DevOps

…So Increase & Promote Value

• By using what you have:– Tests– Code– Systems– Communication

• By digging deeper:– Peers– Customer– Investor– Manager

Page 24: Why Automated Testing Matters To DevOps

Checks and Balances

• The code serves as a test case for the test• The code serves as a test case for the deployment

• The tests serve as tests for the code• The tests serve as tests for the deployment

• The deployment serves as a test for the code• The deployment serves as a test for the tests

Page 25: Why Automated Testing Matters To DevOps

Checks and Balances

• Each touch-point presents opportunity for greater value through:– Efficiencies– Effectiveness– Goodwill– Making life easier for someone • Customer? • Investor?• User?• Peer?

Page 26: Why Automated Testing Matters To DevOps

Creating Value via DevOps Role

• Use friction to create value• What is a failing (or passing) test telling you?• How can you create a better system based on

feedback (like that from automated tests)?

Page 27: Why Automated Testing Matters To DevOps

“Release”

The act of coding, testing & deploying

Page 28: Why Automated Testing Matters To DevOps

A Release Serves as…

• A test of the market• A test of the customer• A test of the business (or business line)• A test of the investment• A collector of revenue (fuels the business)• A test of your role’s value

Page 29: Why Automated Testing Matters To DevOps

• Automated Tests• Deployments as Tests• Code as Tests• Releases as Tests

Each giving feedback you are uniquely positioned to leverage to create value for the

business.

Tests…

Page 30: Why Automated Testing Matters To DevOps

Any test could be a pain in your ____ OR

It could be an opportunity to create value in your systems and lines of business!

Page 31: Why Automated Testing Matters To DevOps

Thank you!

Paul Merrill

@[email protected]