Digging a hole

There’s a tale of how to dig a hole.

Digging A Hole

If you watch a professional dig a large hole they don’t just dig straight down. They build themselves a little set of steps. First one step, then they’ll stand on that one to dig the next, and so on until they reach a depth they’re aiming for, and they’ll dig away the steps.

Don’t be afraid to dig away your steps (intermediate tests) once they’ve got you where you’re going. Developers are often reluctant to delete code, even if it was code they just wrote themselves.

I am NOT advocating deleting tests willy-nilly. I’m talking about trivial, starter tests that have outgrown their usefulness. Stuff like:

Once they’ve been committed, let them go.

People will be able to find them in the future with

git log -S"<magic line of code that I had committed 6 months ago>"
Lance Paine 02 March 2016
blog comments powered by Disqus