The Epistemology of Software Engineering - GOTO...

150
The Epistemology of Software Engineering Nathan Marz @nathanmarz 1

Transcript of The Epistemology of Software Engineering - GOTO...

Page 1: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

The Epistemology of Software Engineering

Nathan Marz@nathanmarz 1

Page 2: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

My personal philosophies on software development

Page 3: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 4: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Agenda1. Limits of human knowledge

2. Effect of the limits of knowledge on software development

3. Embracing those limits enables you to build better software

Page 5: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

How do I know my software is correct?

Page 6: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

How do I know a proposition is true?

Page 7: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Epistemology

Page 8: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

How do I know my software is correct?

PREVIEW

Page 9: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

You don’t

Page 10: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Your code is wrong

Page 11: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

PREVIEW

How do I know a proposition is true?

Page 12: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

You don’t

Page 13: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

True knowledge is unattainable

Page 14: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 15: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 16: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

But wait... philosophy?

Page 17: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Fallacies

StrawmanAppeal to authority

Circular reasoningAppeal to emotion

False dilemmaArgument to moderation

Moral highgroundAd hominem attackShotgun argumentationCorrelation vs causationEquivocationBurden of proof

Page 18: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 19: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Your code is wrong

Page 20: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Your code is literally wrong

Page 21: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Your code is wrong

Page 22: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 23: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Why do you believe your code is correct?

Page 24: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Your code

Dependency 1

Dependency 2

Dependency 3

Page 25: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Dependency 1

Dependency 4

Dependency 5

Page 26: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Dependency 4

Dependency 6

Dependency 9

Dependency 7

Dependency 8

Page 27: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Dependency 3,000,000

Hardware

Page 28: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Electronics

Page 29: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Chemistry

Page 30: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Atomic physics

Page 31: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Quantum mechanics

Page 32: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

I think I can safely say that nobody understands

quantum mechanics.

Richard Feynman

Page 33: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Your code is wrong

Page 34: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Your code

...

Page 35: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Infinite regress

Page 36: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Epistemological “solutions”1. Infinitism

2. Foundationalism

3. Coherentism

Page 37: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Coherentism

Page 38: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Foundationalism

Axioms

Page 39: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

René Descartes

Page 40: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Cogito ergo sum

Page 41: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

I think, therefore I am

Page 42: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Codito ergo sum

Page 43: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

I code, therefore I am

Page 44: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Cartesian foundationalism1. Limited axioms

2. Knowledge through deduction

Page 45: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Cartesian programming1. Axioms = rules of programming language

2. Programs = deductions from those axioms

Page 46: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 47: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 48: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 49: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

-> OutOfMemoryException

Page 50: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

-> Hallo welt!

Page 51: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

All the software you’ve used has had bugs in it

Page 52: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Including the software you’ve written

Page 53: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 54: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 55: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 56: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 57: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Induction

Page 58: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

f(0) and (f(n) → f(n+1)) ⇒ ∀n≥0, f(n)

Page 59: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Induction

Page 60: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 61: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 62: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

<sidenote>

Page 63: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

David Hume

Page 64: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

“Why is inductive reasoning valid?”

Page 65: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

</sidenote>

Page 66: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 67: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Skepticism

Page 68: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 69: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

perfect code

Page 70: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

value to users

Page 71: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

“My software is correct”

Page 72: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

“My software is sometimes correct”

Page 73: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

How do you minimize imperfection?

Page 74: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm’s “reportError” method

Page 75: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

(Storm is a realtime computation system, like Hadoop but for realtime)

Page 76: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm architecture

Page 77: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm architecture

Master node (similar to Hadoop JobTracker)

Page 78: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm architecture

Used for cluster coordination

Page 79: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm architecture

Run worker processes

Page 80: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm’s “reportError” method

Page 81: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Used to show errors in the Storm UI

Page 82: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Error info is stored in Zookeeper

Page 83: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

What happens when a user deploys code like this?

Page 84: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Denial-of-service on Zookeeper and cluster goes down

Page 85: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Robust!

Designed input space Actual input space

Failures!Bad performance!Security holes!

Irrelevant!

Page 86: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Implement self-throttling to avoid overloading Zookeeper

Page 87: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Robust!

Designed input space Actual input space

Page 88: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Robust!

Designed input space Actual input space

Page 89: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Epistemology

Page 90: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

TrthTruh

Trut

TuthTru

Page 91: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Foundation of modern science

Page 92: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

1. When viewed in an inertial reference frame, an object either is at rest or moves at a constant

velocity, unless acted upon by an external force.

2. The acceleration of a body is directly proportional to, and in the same direction as, the net force acting on the body, and inversely proportional to its mass. Thus, F = ma, where F is the net force acting on the object, m is the mass of the object and a is the acceleration of the object.

3. When one body exerts a force on a second body, the second body simultaneously exerts a force equal in

magnitude and opposite in direction to that of the first body.

Newton’s laws of motion

Page 93: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Cambridge, we have a problem...

Orbit of Mercury problem

Page 94: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Einstein’s theory of relativity

Sorry, Newton, you’vebeen PWNED:

Page 95: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

limitn → ∞

approximation (truth)n = truth

Page 96: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Science algorithm1. Make observations

2. Find theories consistent with those observations

3. Falsify theories by making more observations

Page 97: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Foundationalism

Coherentism

+

Page 98: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Empiricism

Page 99: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

John Locke

Page 100: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 101: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 102: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 103: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 104: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 105: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 106: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Occam’s Razor

Page 107: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Software

Use cases

Page 108: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Software gets messy

Page 109: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Refactoring

Page 110: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Robust!

Designed input space Actual input space

Page 111: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Robust!

Designed input space Actual input space

Page 112: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 113: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

TESTING

Page 114: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 115: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 116: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Unit testing

Load testing

Stress testing

Fuzz testing

Page 117: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

TDD?

Page 118: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Review1. Cannot perfectly reason about software• Infinite regress problem• Deduction is fundamentally flawed• Evidence shows programmers are not good at deductive reasoning

2. Best you can do is minimize wrongness• Truth can only be approximate• Observe/theorize/falsify cycle minimizes wrongness over time• Testing = empiricism applied to software development• Make programs less wrong by testing more

Page 119: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Does any of this matter?

Page 120: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

YES

Page 121: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Embrace “your code is wrong”to design better software

Page 122: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 123: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 124: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

RedundancyFault-tolerance > Perfection

Page 125: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

An example

Page 126: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Learning from Hadoop

Jobtracker

Job

Job

Job

Page 127: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Learning from Hadoop

Jobtracker

Job

Job

Job

Page 128: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Learning from Hadoop

Jobtracker

Job

Job

Job

Page 129: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Your code is wrong

Page 130: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

So your processes will crash

Page 131: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm’s daemons are process fault-tolerant

Page 132: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm

Nimbus

Topology

Topology

Topology

Page 133: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm

Nimbus

Topology

Topology

Topology

Page 134: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm

Nimbus

Topology

Topology

Topology

Page 135: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm

Nimbus

Topology

Topology

Topology

Page 136: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Storm

Nimbus

Topology

Topology

Topology

Page 137: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Robust!

Designed input space Actual input space

Page 138: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Robust!

Designed input space Actual input space

Page 139: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Reasoning is fundamentally hard

Page 140: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

So program in ways that require less of it

Page 141: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 142: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz
Page 143: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Pure function

Page 144: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Mutability is hard to reason about

Page 145: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Minimize state mutation

Page 146: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Functional programming

Page 147: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Clojure

Page 148: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

skepticism(skepticism)

Page 149: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

perfect software

??

?

??

??

??

???

??

??

??

? ????

??

?

?

? ?

Page 150: The Epistemology of Software Engineering - GOTO Conferencegotocon.com/.../NathanMarz_KEYNOTETheEpistemologyOfSoftwareE… · The Epistemology of Software Engineering Nathan Marz @nathanmarz

Thank you