Why Is A Math Proof Like A Unit Test

Ben Oakes edited this page Sep 20, 2012 · 2 revisions

A crowd-sourced conference wiki!
Working together is better. :)

Clone this wiki locally

From Gogaruco 2012

Presenter: Daniela Wellisz



Name is from: Why is a raven like a writing desk?

About Daniela

Always wanted to be a mathematician
Mathematicians don't need to think about reality
Mathematicians live in the world of concept
Care about context of problem, not necessarily a solution
Transitioned into Rails very quickly because TDD from the very get-go
How does TDD relate to Math since I love them both so much?


Recursion is based on induction
Induction is away to prove things about integers
If its true for 1, its true for 2, therefore, recursively, its true for all integers

Summation Notation

Sigma notation
A mathematical loop
Placement around sigma indicates location in equation
(see slides)


A programmers concept of an integer is different than a mathematicians
A mathematicians uses axioms
(see slides for Axiom of Induction)

You can't stub something out that means anything

Everything in Ruby is an Object
7 is an instance of an Integer
In Math, 7 comes with a lot of baggage

TDD is not a proof

Your test suite isn't a proof that you code works
Its important to understand which function it provides
Unit tests are heuristics rather than proofs Before you solve a problem, you have to understand it
If you do Outside-In-Development and start with integration tests, you will understand your problem
You have to break problems down into smaller and smaller chunks until you find the easiest problem to solve

Understanding math and understanding the differences between tests suites and proofs is very important because you can explain test driven development


Approaching... slide
Test Driven Development... slide
Understand... slide