@yakticus illusions of certainty co-founder, order of ......illusions of certainty what the brain...

69
Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude Labs @yakticus

Upload: others

Post on 12-Jun-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

Illusions of CertaintyWhat the brain can teach us about software engineering

Julie Pitt

Co-founder, Order of Magnitude Labs

@yakticus

Page 2: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 3: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

github.com/yakticus/IllusionsOfCertainty

relevant links found here:

Page 4: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

“For the things we have to learn before we can do them, we learn by doing

them.”

― Aristotle, The Nicomachean Ethics

Page 5: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

today we will discuss

➔ a BIG reason why software projects are unpredictable

➔ how to help computers better understand what we mean

➔ how to make our software systems more resilient

➔ how to better understand what our software systems are doing

Page 6: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 7: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 8: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 9: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

life

Page 10: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

life: a generative model with an interface to the world

the world

senses

action

generative model

Page 11: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

survival

Page 12: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

workingworking

not working

Page 13: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

software as a generative model

the world

input

output

the code

Page 14: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

software as a generative model

the world

input

output

the code infinite precision

Page 15: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 16: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 17: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

misjudging uncertainty in software

reality

perception

Page 18: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 19: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

human precision

don’t kill humans

be nice to people

don’t hurt people

keep humans alive

respect human life

don’t kill humans

Page 20: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

machine precision

don’t kill humans

be nice to people

don’t hurt people

keep humans alive

respect human life

Page 21: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

machine precision

don’t kill humans

be nice to people

don’t hurt people

keep humans alive

respect human life

Page 22: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

the cliffs of infinite precision the happy

path

utterly

broken

Page 23: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

how do we get to this?

optimal

degraded

resil

ien

ce

Page 24: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

ways we can cheat

➔ property tests

➔ remedy-first design

➔ build intuitive insight

Page 25: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

property tests

Page 26: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 27: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

test suite as a generative model

system

under test

y

x

test suite

Page 28: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

individual test cases are often too precise

software system state space

desired behavior

tests(“training examples”)

Page 29: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

testing an addition function: F# example

state space

credit: http://fsharpforfunandprofit.com/posts/property-based-testing/

✅test passes

Page 30: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

overfitting to tests

state space

bug

credit: http://fsharpforfunandprofit.com/posts/property-based-testing/

Page 31: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

property tests combat overfitting

state space

bug

credit: http://fsharpforfunandprofit.com/posts/property-based-testing/

Page 32: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

property tests: let’s review- test suites are generative models

- describe the properties of your system

- requires less precision

- test the properties

Page 33: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

remedy-first design

Page 34: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 35: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

GET /api/metadata/12345

{“status”: “failure” “error”: { “errorCode”: 234 “description”: “database timeout” }

input outputRESTful service

client falls

off cliff

Page 36: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

each error has a precise cause

read timeout

connect timeout

connection pool

exhausted

token expired

credentials

revoked

key rotation

endpoint moved

endpoints expired

failover

user error

insufficient

permissions

account problem

Page 37: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

remedies are imprecise

read timeout

connect timeout

connection pool

exhausted

token expired

credentials

revoked

key rotation

endpoint moved

endpoints expired

failover

user error

insufficient

permissions

account problem

RETRYREDIRECT

DISPLAY

ERROR

RE-AUTHENT

ICATE

Page 38: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

remedy tells the client how to ease pain

{“status”: “failure”“failure”: { “action”: “RETRY” “error”: { “errorCode”: 234 “description”: “database timeout” }}

remedy

(actionable)

Page 39: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

What about failures that weren’t predicted?

Page 40: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

AWS outage - 2012/10/22 -> DNS change didn’t propagate

-> indirectly triggered a latent memory leak

-> insufficient alerting; failovers happened too little, too late

-> API throttling affected some customers more than others

-> many popular internet services down for hours

failure comes in many forms

Page 41: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

AWS scheduled maintenance - 2014/09/25 -> time-sensitive security update on 10% of EC2 nodes

-> required reboot of those nodes

-> possible impact to customer applications running on those nodes

failure comes in many forms

Page 42: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

AWS DynamoDB outage - 2015/09/20 -> DynamoDB failed in us-east-1 region

-> dozens of dependent services also failed

-> many prominent internet services were taken down for hours

failure comes in many forms

Page 43: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

Netflix was prepared

Page 44: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

meet simian army- OSS project by Netflix

- deliberately cause failures in a controlled

manner

- e.g., randomly takes down AWS ec2

nodes, datacenter, or region

- validate whether the system handles

failure

Page 45: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

simian army -> cultural change- failure is the norm

- simulates the nature of failure and

not the cause

- we can’t predict all causes of

failure

Page 46: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

remedy-first design: let’s review- design with remedies in mind

- # remedies << # causes

- test resilience during business hours

- find out what you’re up against when wide awake

- use a tool that is agnostic to causes

- e.g., simian army

Page 47: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

intuitive feedback

Page 48: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

is it working?

Page 49: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

logs: easy to produce

Page 50: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

logs: hard to consume

Page 51: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

charts

Page 52: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

charts: easier to consume, but still hard

Page 53: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

we want the whole picture

Page 54: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

solution: leverage our intuition

Page 56: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

thought experimentWhat if your software system’s interactions sounded like cars on the road?

Page 57: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

intuitive feedback: let’s review- humans want to know “is it working”?

- the tools of today inhibit us from seeing the big picture

- we need tools that leverage our intuition

- e.g., vizceral & TBD

Page 58: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

conclusion

Page 59: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude
Page 60: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

curiosity-driven tests

system

under test

senses

action

test agent

(neural network)

Page 61: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

mapping the state space through exploration

state space

begin testing random

states without

expectations

Page 62: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

mapping the state space through exploration

state space

gradually build a

model containing

expectations

Page 63: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

mapping the state space through exploration

state space

model capable of

recognizing

anomalies

Page 64: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

self-healing systems

telemetry

senses

action

ops agent

(neural network)

deployment,

scaling,

failover, etc.

Page 65: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

workingworking

not working

let’s review

Page 66: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

goal: change the landscape

Page 67: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude

the end.

Page 68: @yakticus Illusions of Certainty Co-founder, Order of ......Illusions of Certainty What the brain can teach us about software engineering Julie Pitt Co-founder, Order of Magnitude