Do you test? Do you test all the time (TATFT)? Can you afford to lose $600?
I believe software testing is essential. Behaviour Driven Development (BDD) is something that I’m learning and incorporating into my development lifecycle. I use Cucumber and RSpec with my Rails projects to implement new features and to verify their behaviour.
Aside from driving your design, validating your code, and giving you and your stakeholders confidence in your app, testing saves you money. That’s the bottom line. You might not think so. You might be able to get away with zero testing if you are extremely lucky or if you are a super coder who writes perfect software. Ultimately, the time you invest in writing tests for your code will save you time and money.
I recently made a small change to my SciNews web application without writing a test. Why? Because it was just a small change and I was in a rush. I had opened the app in my browser and tried it out and everything was fine and dandy – deploy!
A month went by without any problems. Admin users of the system weren’t experiencing any issues but when a client user tried to use the service – WHAM! BAM! ERROR!! So there I was, just before midnight, on the receiving end of a support call from the client trying to figure out what just went wrong.
I tried to fix it on the spot but I didn’t understand the cause. The only change I made was a minor one about a month ago and admins had been using the system fine during that time. But this was the first client access since then. Aha! But unfortunately, after 15 minutes on the phone with the client, I was unable to solve the problem. As I later discovered, the bug affected client roles, not admins. When I tested it in the browser, I had done so using my admin account. I never tried it as a client.
In the end I had to manually perform the service for the client on their behalf. But the system had failed them and worse, it was their first use of the online service. In order to save face, compensate them for their wasted time and frustration, and to keep them as clients, the service was provided gratis. My small little insignificant change had ended up costing my business $600 and for a small, fledging business, that’s a lot of money that we can’t afford to lose. For $600, I should’ve written a test! Add in time spent on the phone with the client, the embarrassment, and the potential damage to the service’s reputation, I should’ve definitely written a test.
Will this client come back and try our service again? I hope so, otherwise my little error may well end up costing heaps more in lost revenue. This client may have become a repeat customer, so we’re talking a loss of $600/mth. And what about word of mouth? They might have referred two new clients. Now we’re talking some serious lost revenue here all because of one small minor change. Hopefully I’ve done enough with that client for them to give the service a second chance. Whether they do or not, I’ve learnt my lesson – TATFT!