6. Why Unit Test?
• Low TCO
• Small setup
overhead
• It’s not a bug if
it’s caught before
QA
• Go faster
• Quick feedback
• Knowing your
code works
• Confidence to
change your code
• Quicker than
debugging
7. The death spiral
• Tests are slow
• Stop running tests
• Stop writing tests
• Back to square one
22. Working software
• Automated builds
• Automatic build
• Run unit tests
• Run integration tests
• Unit tests and TDD
Over comprehensive documentation
27. Death star explosion
probability calculator
• Only Luke can shoot correctly
• Explode if core temperature > 500
• 1000 X-Wings
• Probability of Luke being hit depends on the
other X-Wings
p(success) = 0.3(X-Wings)
• Probability of X-Wing surviving degrades in
time
p(survival) = 1/t2
• Calculate Luke's hitting probability every 100
time units