Tests become even more important to me when I'm coding alone. They allow me to focus on the here and now of my code while not having to spend a ton of time thinking about what I will probably break by making a change. They are in essence, my second set of eyes. Just yesterday I changed the very foundation of my current project because I found out I was doing it a bit wrong. (Side note: If I'd been programming as a pair we probably would have found this much sooner.) Rather than hack a fix because I was so far along, which I've done plenty of times in the past, I rewrote the foundation of my code-base. I only attempted this because I had the confidence that my test coverage would help me get back to where I needed to be in a short amount of time.
This quote from Michael Valenty is one of my favorites, "It’s like rediscovering that diet and exercise is the key to losing weight, except that I rediscovered that not having tests really sucks when you have to make changes."
No comments:
Post a Comment