Recently we uncovered a bug in an application that went to production. I wasn't working on that project anymore, however i took time out of my current project to investigate the cause of the bug. Turned out that the bug was a mistake that was quite easy to make. Instead of doing an 'ilike' on a database search, the code was actually doing an 'eq'. That one method was the difference between a case-insensitive search and an exact match. Easy enough mistake to make, given that most searches on a database are exact matches!! (think booleans, dates, enums, numbers, etc).
Anyway, taking the approach of transparency, i fully explained to my clients the cause of the bug and the fix required.
What happened next? ... I got shot! Worse still, it was over email and CC'd to a number of people.
Instead of taking this information and using it constructively, the client decided to use it against me specifically and shoot me down. Seems that in their eyes the bug should never have happened because case insensitive matches are standard! This apparantly ignores searches over different types of fields, such as booleans and enums and numbers, all of which generally use exact matches and more importantly use the same code function as string searches.
Here is exactly what I mean ... See how easy it is to accidently use the 'eq' instead of 'ilike' when doing a search by the name? Especially when you are applying other fields to a criteria, all of which use 'eq' perfectly legitimately...
...
session.createCriteria(Person.class)
.add(eq("type", data.getType())) // this is ok
.add(eq("phoneNumber", data.getPhoneNumber())) // this is ok
.add(eq("name", data.getName())) // should be 'ilike', not 'eq'
.add(eq("dateOfBirth", data.getDateOfBirth())) // this is probably ok
.list();
...
Also, it seems that in their eyes I was the only one responsible for delivering this functionality. The reality is that there were 5 people involved in testing this thing, all the way from the developer to the system testers to the people involved in UAT. Nobody picked up the bug. Its amazing how obvious everything is in retrospect, isn't it?!
Yes... yes i was ...
Anyway, perhaps it is just the culture at this this particular clients workplace. I certainly haven't been shot at any other client site i've been at...
The moral of this story? Transparency gets you shot. Now i understand why ppl who work in corporate cultures create a curtain of smoke and mirrors around their work ...
Comments ...
meetings, then complaining that there are too many meetings, are a good way of
making it SEEM like you're doing work when in fact you're not doing anything at
all, thus removing yourself from any blame for anything that goes wrong >_< ......
just like the best way to not break the build is to not check any code in
"Try not to become a man of success but a man of value. Albert
Einstein."
You got the job done in the end, so well done. Hope there's a test case built
around that now
brighten up your day with some more Ze Frank and Arjie Barjie.
Btw I love pork rolls.
an move on.
Next time just have a code review.