It is crunch time. QA logs a critical defect and it ends up in your queue to fix. A few clicks, key presses, and browser reloads later, your fix is ready to commit for the nightly build. Happiness is fresh code. You even remembered to test out the change...or did you?

I admit, I can be a slacker when it comes to unit testing. Happy path all the way. But my freewheeling, cowboy testing day came to a halt when my code change impacted more than I thought. Yep, I did not fully test my couple lines of code, hitting all the possibilities to make 100% sure I did not break something.

The problem was simple: the front end sends the data to the server via a POST of JSON data. The form input value was formatted as an array, a generic way of dealing with the possibility of multiple responses. The server side code, however, expected a simple value. A quick arrayToList() and the form was humming along.

In my enthusiasm, I updated more than one line in the code to use the new (hackish) approach. In my drive to close out the ticket, I only tested the documented problem, ignoring the tests for the other extra lines. Come the morning, I had two new issues documenting related problems...problems I created.

Lesson learned: if you change it, test it.