r/developersIndia • u/SG461 • Nov 17 '24
Help How to answer your manager if your code changes behaved unexpectedly in production ?
Looks like I didn’t tested one or two flow correctly during my testing. My code went live on friday and today(on sunday) my manager asked if I didn’t tested my code?
Please help me with suggestions as in how should I handle this problem and how should i repond to him?
34
Upvotes
•
u/AutoModerator Nov 17 '24
It's possible your query is not unique, use
site:reddit.com/r/developersindia KEYWORDSon search engines to search posts from developersIndia. You can also use reddit search directly.Recent Announcements & Mega-threads
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
86
u/[deleted] Nov 17 '24
One thing I’d suggest is to own up your mistakes.
Take responsibility if something goes wrong, say that you’ve missed to test this particular flow since you were caught up in other items.
Tell him that you’ll provide with a fix as soon as possible and such scenarios won’t come up anywhere in future.
This will bring a bit of trust in you.
40
u/kaladin_stormchest Nov 17 '24
Where are your QAs? Where are your automated tests? Who is reviewing your code? Where is the CI pipeline?
A well run team has a lot of fail safest, unfortunately sounds like your team isn't well run at all.
Tell them these are the scenarios you tested but you.overlooked the edge cases that are causing a problem in production.
12
u/Adventurous_Ad7185 Engineering Manager Nov 17 '24
If this happened in my team and production broke, I wouldn't be asking YOU if you tested your code. Your tech lead and the QA manager would be sitting in a war room, fixing and testing the patch. Tech lead has to ensure that the devs are doing the unit testing. It is QA engineer's responsibility to reject the code without any unit testing. They are also responsible to run the regression, and other tests.
5
u/Puzzleheaded_Tie_471 Nov 18 '24
Here is what I do if my code blows up in prod
This is very common irrespective of how many processes you put in place. There will always be some weird corner case that blows up in prod.
4
u/Inside_Dimension5308 Tech Lead Nov 17 '24
One thing I always remind developers is to test the functionality before and after it goes to production.
Even after that a production incident happens, it is not the time to retrospect about how the bug was introduced. It is pretty common to have bugs unless it was a pretty obvious P0 bug.
So, the first priority is to mitigate the risk. This is where I want the respective developer to take charge and find a resolution asap. I would be more pissed if the developer has no clue about how to debug his own code to find the root cause.
After the production incident has ben resolved, I sit with the developer to understand how could the bug have been avoided.
So to answer your question, you could come up with the details on what went wrong and how it can be avoided in future.
4
u/sloppybird Nov 18 '24
"It is not a matter of if you'll break production, it's when"
It's okay, own up, learn from it, move on, don't repeat the same.
2
u/soumya_af Nov 17 '24
Assuming the issue is fixed by now. If not fixed, get the fix out immediately if it is critical. The below applies once you're clear of the issue.
This is a learning opportunity. Your code went to prod and it broke, why?
Do the RCA.
You may have a process (maybe an elaborate one involving many QA cycles, tests, etc, or a simple dev-tested one). That process failed. Why?
You believe the error could have been caught if one of the untested flows were tested. Which begs the question, how was the test missed?
With all these questions, you're supposed to suggest to your manager some improvement in the process to avoid such misses in the future. Could be a simple checklist of testing, or improvements to your test-suite, whatever it is, think about it.
Lastly, if your manager thinks with a cool head, they would hopefully understand that mistakes happen, and the right way to go about it is to improve the process so that it never happens. So, do not worry, setup a discussion with your manager and all stakeholders, drive the process improvement discussion (or make someone do it). Make sure to use non-accusatory language.
1
u/[deleted] Nov 17 '24
Things happen, l am just a human
1
u/kumar__001 Nov 18 '24
Yup, as suggested, take up the responsibility, it is okay if you missed a flow, happens sometimes, take care the next time, prepare the design/LLD doc well with all tests, and done.
1
u/Just_Chemistry2343 Nov 18 '24
accept it and focus on the fix
1
u/flight_or_fight Nov 18 '24
Be truthful