Testing Is Like Pulling Up a Bucket of Water from a Well
One analogy that I love to use is that testing is like clipping in when climbing or having a ratchet to save your progress.
You write tests and those tests they give you a regression against behaviour that you have fixed before. You can make small bouts of progress and always return back to that baseline of wherever you were before.
This example comes from the book Test-Driven Development by Kent Beck:
Ultimately, programming is hard. Often, we are smart, so we succeed. TDD is there to help us out when we’re not so smart.
Kent Beck (who basically invented TDD) uses the metaphor of lifting a bucket of water out of a well with a rope: when the well isn’t too deep, and the bucket isn’t very full, it’s easy.
And even lifting a full bucket is pretty easy at first. But after a while, you’re going to get tired.
TDD is like having a ratchet that lets you save your progress, take a break, and make sure you never slip backwards. That way you don’t have to be smart all the time.”
Comments