<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jamey Abdelnoor on Medium]]></title>
        <description><![CDATA[Stories by Jamey Abdelnoor on Medium]]></description>
        <link>https://medium.com/@jameyabdelnoor_78981?source=rss-92b5e9ffebe7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*W7ILzDYBHiYKq_PR1pOMJw.jpeg</url>
            <title>Stories by Jamey Abdelnoor on Medium</title>
            <link>https://medium.com/@jameyabdelnoor_78981?source=rss-92b5e9ffebe7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 22:05:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jameyabdelnoor_78981/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The 5 w’s of journalism, and why they should be employed against bugs]]></title>
            <link>https://medium.com/@jameyabdelnoor_78981/the-5-ws-of-journalism-and-why-they-should-be-employed-against-bugs-80f38be71e03?source=rss-92b5e9ffebe7------2</link>
            <guid isPermaLink="false">https://medium.com/p/80f38be71e03</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[bugs]]></category>
            <dc:creator><![CDATA[Jamey Abdelnoor]]></dc:creator>
            <pubDate>Mon, 28 Mar 2022 14:37:01 GMT</pubDate>
            <atom:updated>2022-03-28T14:37:01.574Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently went through the interview process, and came across a lot of interesting questions and challenges which encouraged me to think differently, or more in depth about certain subjects.</p><p>One such question caught me off guard and seemed on the surface to be a silly one, like asking someone how they go about breathing. I gave a succinct answer which seemed fine at the time, and we moved on. However for weeks after the interview, my mind kept getting drawn back to this question, and in this article I would like to present the answer I would now give.</p><p>But first the question: “<em>How do you go about fixing a bug?”</em></p><p>My answer? “Determine what’s gone wrong, create a branch to fix the problem, test that it is fixed, create a pull request”. After a moments pause, I added “also I guess make sure I can reproduce the issue reliably before the fix, so that I can be sure that the fix is successful”.</p><p>I don’t know whether other candidates gave better answers, or what the employer thought of mine. I received no feedback to indicate one way or the other, and thought so little of the question that I didn’t care to follow up when the interview moved on. Only a few weeks later when I woke up at 4.30am with this question bugging me [hehe] did I decide to sit down and figure out a better answer. In a moment of clarity in the pre-dawn light, I realised that I actually followed a three phase process for bug fixing already. Thinking about it has helped me conceptualise and refine the process, and I put it here in the hopes that it may help others too!</p><h3><strong>Phase One — Understanding</strong></h3><p>Before fixing any bug, we need to understand what is going wrong (obvious, I know, but bear with me). I do this using the five w’s of journalism, with each stage feeding into a narrative which allows me to build a coherent explanation of the issue, and how to fix it. This process can take seconds, hours, occasionally weeks (hopefully not longer!), but I guarantee that any developer who has fixed a bug has done at least two of these steps.</p><h4>Step 1 — What?</h4><p>This is one of the two steps that every bug fixer will have done. The ‘what’ is the best place to start, and is a very short and simple step. All we need is a summary of the problem. We don’t need details, we don’t need to look at code, sometimes we don’t even need to know anything about the software. The ‘what’ is as simple as “I get an error logging in”, or “double-clicking to place a new order submits two orders”, or “dragging a file onto the application causes it to hang”.</p><p>The ‘what’ is our reference point, a human-friendly id. It is most likely the title used to create a ticket, it is the thing we use to describe what we’re working on, it is likely to be the subject line in an email from a customer raising the issue.</p><p>The ‘what’ barely needs any clarification, and yet it already gives us a sense of where to look in the code base. All we need to ask is “What’s wrong?”.</p><h4>Step 2 — When?</h4><p>The ‘when’ is a direct follow up to the ‘what’, and the question we’re asking is “when does it happen?”. The ‘when’ could be (sticking with the same examples) “when logging in on my phone”, or “sometimes but not always”, or “when dragging files with the .zip extension”.</p><p>The purpose of the ‘when’ is to establish reproducibility. Some developers may skip this step, and this can be OK if the ‘what’ already supplied all the relevant information (the ‘when’ is already known). At times we may feel forced to skip this step because the person who reported the issue is not responsive to follow-ups. In either case don’t skip this step. Without 100% reproducibility, until we fully understand exactly ‘when’ an issue occurs, we cannot prove that the issue is fixed. I have seen a fair few pull requests which have skipped this step, and failed to resolve the issue as a result. Sometimes these PR’s have fixed a different issue in a similar area of the application, sometimes they’ve reduced the likelihood of the issue occurring, or moved the problem around.</p><h4>Step 3 — Who?</h4><p>A very simple step, “who does this issue affect?”. The ‘who’ could be “user-id:47297430”, or “all users”, or “users who haven’t subscribed to the pro edition”. The ‘who’ is most useful for prioritisation. When looking at a number of bugs, a bug that only affects a small sub-set of free users will likely be deprioritised over one which affects all paid users.</p><h4>Step 4 — Where?</h4><p>We now have enough information to start actively digging into the code. The previous three steps are enough to get a good sense for where to start, and will likely be reactive (waiting for a user to report the issue, and respond to follow up questions). The ‘where’ is likely to be the first step which we refer to as “working on a ticket”, and the question we are asking is “where does this problem occur?”. For example “where the authentication service calls the database”, or “where the button click is handled”, or “line 74 of the file resolver service”. The ‘where’ is the second step that every bug fixer will have done (can’t fix a bug without finding a line to fix).</p><p>I won’t go into too much detail for the ‘where’, because everyone does things differently, but it is common to attach a debugger, follow a log file, or jump straight in with a stack trace, and use this to figure out where things are going wrong. In some cases a stack trace may be a symptom rather than the cause of a problem. For example a user name could be null, and some code tries to operate on it causing a null pointer. Of course this usage should probably be fixed to be null-safe, but it’s also important to track down how the user name became null in the first place, since this is likely the root cause of the problem.</p><h4>Step 5 — Why?</h4><p>Sometimes this knowledge floods in once the ‘where’ has been established. “Oh, this is because the live db configuration is missing for this service”, or “This is because the button isn’t disabled while the form is processing”, or “This is because the software gets stuck in a loop waiting for the user to upgrade to the pro edition”. Sometimes this light bulb moment can even occur straight after step 1, if there is excellent familiarity with the code base.</p><p>If we find ‘where’ a problem is occurring but don’t put in the work to figure out ‘why’, then similar to the ‘when’, we cannot prove that the problem has been solved. Like the example above where the stack trace was a symptom rather than a cause. If we can keep asking ‘why’, then we probably haven’t found the problem yet. If I run into a situation where “your symptom is in another castle”, then I try and resist climbing immediately into the rabbit-hole of doom, and instead solve the problem I’ve found, and create a new ticket to start the process again with the nested problem.</p><p>This makes the work which goes into resolving a bug much more visible, and has greater returns the more convoluted that the actual issue is. It also makes it more likely that spill-out issues will actually be fixed, since they are likely to be forgotten once the root issue is found.</p><h3>Phase 2 — Fixing</h3><p>Once the problem is understood, we’re ready to fix it. For me, this involves three steps; consideration, recommendation, and implementation. It can be tempting to jump straight into implementation, to fix the problem and get back to some ‘real code’. Often this is fine. So many bugs are trivial to fix, and having any sort of bureaucratic process which slows things down is a waste of everyone’s time. For example, a typo in an interpreted file, or a constant whose value doesn’t match that in the database. If a fix is more than a few quick lines though, I’ll start to use this process.</p><h4>Step 1 — Consideration</h4><p>Before solving any problem, before getting my hands dirty, I always consider my options. Developers are going to solve the same problem differently unless it is for the most basic of changes. Even in the above example with a mismatch between the database and the code there are two obvious but different solutions. Update the value in the DB, or update the value in the code. A third option might be to do both, maybe the developer is unhappy with the terminology used, or they could even decide that it’s a bad pattern and remove it entirely, leading to a whole new range of options.</p><p>Consideration allows time to think about various different solution without committing to a particular one. Sometimes it’s easy to start writing something a certain way, and when it gets tricky to keep digging rather than stepping back and considering alternatives.</p><h4>Step 2 — Recommendation</h4><p>Once I have a bunch of suggestions, I need to figure out which one to use. Recommendation is the best time to report significant progress back to the team. “Here’s what I’ve learnt about the problem, here are various ways we can fix it, and here’s the way I think we should fix it”. Recommendation encourages me to outline various proposals, and make it clear what the strengths and weaknesses are. We also should have a decent idea of how involved each solution is, to get an idea of how long it might take to implement. Again, this can be overkill in many cases, interrupting the entire team to talk about a typo is a waste of time. But in the case of multiple wildly different recommendations, there’s a chance we’ve found some technical debt. Talking about these is the best opportunity for another member of the team to pipe up and say “Oh, that was done that way to handle this random use case”, or “I think that’s needed to work around an issue with the library”. Best to find these things out before sinking precious hours into a solution.</p><h4>Step 3 — Implementation</h4><p>We have agreed a solution to the problem, and so it’s time to fix it! Now the advantages of the recommendation step come into play because we have a clear goal (beyond simply “the bug is fixed”), and a rough timeline. It’s possible that as we nestle into the code and start to make it home, we learn that there’s more complexity than was visible at first. This is an opportunity to consider going back to step one or even phase one, to deepen our understanding and develop or try out different recommendations. This way it’s easier to stop over-committing to a solution when things starts to go wrong. The process builds a paper trail which can help to see exactly how the solution was reached, useful for the ones which are very involved, and it also helps to raise red flags for concerning areas of the code base. If multiple different recommendations are tried, and the solution is tricky to deliver, then most like the section of code needs a refactor.</p><h3>Phase 3 — Reflection</h3><p>Great, we’ve fixed the bug! Maybe it’ll get deployed immediately, or maybe it’ll be merged up the tree for a future release. But before we move on and forget all about this bit of the code, it’s a good idea to reflect on how the bug arose by asking various questions. “Was this bug caused by outdated or low quality code?” — If so, maybe a refactor is needed. “Was this bug caused by a process issue” — If it was, maybe the process should be changed. “Is a similar bug likely to exist in multiple different places?” — If it is, those other areas might need to be assessed before the issue is forgotten. “Have we created tests to prevent a regression?”.</p><p>Even for the smallest of mistakes like a typo, these questions are worth asking. Possibly not in the cases where the issue is caught early like a continuous build environment, but in any case where it has reached all the way to the live system, it’s worth taking the time to question how. Reflection is not so much about preventing this specific issue from occurring again, as it is assessing the class of issue, and reducing future pain points.</p><h3>Summary</h3><p>This is the answer I would have liked to give, had I given the question some serious consideration in advance. At least now I have a better answer should I be asked again, and it has forced me to think in depth about the process I use which will hopefully make me a better developer.</p><p>If nothing else, I hope I can sleep in a bit longer tomorrow!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=80f38be71e03" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>