Slide 34
Slide 34 text
Unit Tests
• Helping you think
through bottom-up
designs
• Preventing
regressions
• Getting you to the
point where at least
something works.
Are Great
• Showing overall
design consistency
(top-down)
• Finding security holes
• Proving correctness
or totality of
implementation
Not So Helpful
We can use techniques like strong typing, fuzzing, and formal methods to compliment testing to give more control over code correctness. You will still need tests, but
you’ll get much more “coverage” with fewer tests.
Looking at the lists here, a theme emerges. To write a test, you needed a mental model of how your function should work. Having written the tests, however, you have
thrown away the model. All that's left are the examples.