Code Craft: Reduce Stress, Write a Test
(Tue Jul 19, 2005) [/CodeCraft] #
Writing pristine code isn't enough. Without tests, you don't have the confidence to modify the code predictably. Rather, every time you touch the code a cold chill runs up your spine and your typing fingers tremble with fear. You've been bitten before—an innocent change here unknowingly breaks something over there, and what you thought would take mere minutes has turned into several painstaking hours. And so the police tape is strung permanently around the code, workarounds are used to spare the team from going into those crime scenes, and before long what once was the cleanest code on the planet has decayed into the nastiest code imaginable.
It doesn't have to be this way. In the latest installment of my Code Craft column, "Reduce Stress, Write a Test", we drive out fear and boost productivity with the help of a test.
