Yesterday, during the live coding portion of the TDD webinar that I had prepared for two weeks prior, I hit an unanticipated bug in my code.
Right there, in front 60+ people, I needed to debug my presentation and get it back on track.
But here's the thing: I had spent the previous ten minutes writing tests. I knew that the bulk of my code was working, because I could see the passing tests. Better yet, I knew exactly which parts of the code were working.
That meant that right off the bat, I could narrow down the problem to about 3 lines of code. In less than a minute, I was back on track.
Testing. It works :)
And since we're talking about debugging: Did you know that I recently released a premium course that covers debugging web applications? Let me help you make sense of your code when things don't go as planned.
Enjoy your day. More tomorrow!