If I am assigned a bug, I sometimes check version control to see when it was introduced. Should I notify the developer that introduced the bug, even if I already fixed it? The advantage is that it could help learning but the disadvantage is it could seem like criticism
closed as primarily opinion-based by user40980, Robert Harvey, Ixrec, gnat, user22815 Jan 21 '16 at 17:22
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
If it's part of your process, then yes. If it's specifically not part of your process, then no.
If it's not specified, the best thing is to ask the developers if they would like you to notify them if you fix bugs in their code and to respect their individual wishes.
If you don't want to do that or it's too complicated, you can let them know that you found a bug. If you think that they will feel criticized, you can pitch it as "I fixed this thing that you had worked on before, and I am now appealing to your prior knowledge to make sure that I have considered all the subtleties in doing so." In other words, you're not saying their code was screwed up, but that you respect that their deeply-thought solution might be more complex than your own superficial understanding, and you want their expert consideration for the repair work you undertook. This has the advantage of making sure that they are aware of the code defect (and subsequent learning opportunity) without being affronted.
I think, if you found a bug in some developer's area, the best course of action would be to ask that developer to code review your changes.
This way you are not hurting somebody's ego, you are just doing your job (fixing a bug assigned to you, and making sure you don't break more as a result of the 'fix').
Build a conversation in these terms.
- I am assigned to work on Problem X (don't mention it's a bug).
- I analyzed the code and I see that the best solution for it is to modify code in the Area Y, which you own.
- Can you, please, review my solution that I didn't break something I don't know.
From experience, people react much better if you ask their opinion proactively, than by finding out your changes in their code.
At the very least, you should notify them that you have discovered a potential bug with their code. This could be considered criticism (and you must be certainly be constructive when criticizing); but there is also potential that what you have found is not actually a bug.
By notifying the responsible party, you aren't just assigning blame. You are also giving the author an opportunity to defend his actions. It may well be that the "bug" was an intended (or discovered) feature that is relied upon by your users. It is also very possible that, even in the case of a real bug discovered, your solution overlooks corner cases that the code's author is more familiar with.
By notifying a bug's author, you also give them the opportunity to rectify any other similar mistakes they may have made. If they have made a mistake in one place, it is likely that they may have made a similar mistake in others.
Just make sure it is constructive criticism, and tell him how you fixed the bug, so he doesn't make the bug again.
Are you the maintainer of the code? If so fix the bug, document the fix, and don't go pointing fingers to who's "to blame" for it in the first place.
Is someone else the maintainer? What were you doing digging through their code in the first place? Notify them that you found a potential problem and where it's located. Maybe give them hints on how to fix it if you've got some. Don't go pointing fingers and laying blame for the problem.
Did you have no business digging into that code? Shame on you, you were wasting your time doing things that aren't your responsibility and might even be in violation of workplace policies regarding access to documents that aren't required for you to do your job.
Way you wrote your question, you seem to just want to gloat to the people who "made the bug". Which is quite often not even the case. Code changes, something that's correct at some point may not be correct later after code somewhere else changes, causing problems with the input of that original code which causes it to misbehave.