4. 4
Defensive programming is a form of
defensive design intended to ensure
the continuing function of a piece of
software under unforeseen
circumstances. Defensive
programming practices are often
used where high availability, safety or
security is needed — Wikipedia
6. 6
WW3, ALMOST…
In 1980, NORAD reported that the US was under missile attack.
The problem was caused by a faulty circuit, a possibility the
reporting software hadn’t taken into account.
DEADLY RADIATION THERAPY
A bug in the code controlling the Therac-25 radiation therapy
machine was directly responsible for at least five patient
deaths in the 1980s when it administered excessive quantities
of X-rays.
BUGS
7. 7
ROCKET LAUNCH ERRORS
The European Space Agency’s Ariane 5 Flight 501 was
destroyed 40 seconds after takeoff (June 4, 1996). The US$1
billion prototype rocket self-destructed due to a bug in the
on-board guidance software.
LOST IN SPACE
One of the subcontractors NASA used when building its Mars
climate orbiter had used English units instead of the intended
metric system, which caused the orbiter’s thrusters to work
incorrectly. Due to this bug, the orbiter crashed almost
immediately when it arrived at Mars in 1999. The cost of the
project was $327 million.
8. “You can’t sleep well if you are
not confident that your last
commit didn’t take down the
whole application”
8
14. Writing unit tests will help you adhering to common
principles such as High Cohesion, Single Responsibility, Low
Coupling and right object composition
Test
test test!
14
16. As developers shouldn’t trust others developers’ code.
We shouldn’t trust our code neither.
Code Review
16
17. Stop hoping your users will report
errors. Monitor and fix crashes in
real time. Iterate continuously.
Boost efficiency. Improve user
experience.
Tracking Error
17