Oh Blimey!!! My Tests Didn’t Catch This Case

The other day I committed a very grave error, one that should never be heard of.
I had this application I had written a couple of years back when I was just getting introduced to MVC frameworks and the methodology.
SO what did I do wrong? Imagine a portal where you make purchases online. Then imagine a cart with just one item and the price that the user will be paying.
Now imagine this, I did a pre-validation on the amount before the user sees the confirm transaction button.
But right in my code, I didn’t check verify that the customer had sufficient credit to complete the transaction.

Funny, this went unnoticed for over 3 years and I just discovered it when I saw two customers with a negative balance and received a complaint from one of them about the transaction from the unverified link.

Would I have detected this with Unit testing? What other methods of testing would catch this sort of buggy implementation?
Let me know what you think…


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s