Software Developer with over 45 years commercial experience · Author has 12.3K answers and 14.3M answer views · 3y ·
It Depends (tm). On whether you mean:
- whilst stepping through a production run problem with a debugger (like debug or gdb), or
- just as part of initial development, or
- making changes to a programme already in production.
I would ask different questions. Anyway, some questions I would variously ask are:
- Does the source code I'm looking at, match the programme that's executing?
- Can I duplicate the misbehaviour in a unit test? This means that A) I can reproduce it on demand, and B) know when I've fixed it.
- Can I verify the correct behaviour of the rest of the programme with unit tests? This will ensure that, when I've found and fixed the problem, that I haven't broken something else.
- How long do I spend on trying to fix this? I love finding and fixing problems, but in a business, sometimes it's not financially viable to fix every problem. It them becomes a Fact Of Life, and the Operating Manual is changed to read “Do not change the discount category for new customers until the second End Of Month has been run. Issue a manual Credit Note, otherwise you'll crash the Statement Printing run.”
- What false assumptions am I making? You've tried to Debug this for hours/days/weeks, but something doesn't make sense. The computer isn't doing what it's been told to do [I have encountered this FOR REAL (as opposed to a false assumption) only twice in 45+ years]. The error message says that the customer ID doesn't exist, but it does [turned out my SQL query was against the Wrong Database]. It's throwing a DivideByZero exception but nothing is zero [here's where stepping through with a debugger will show you where the false assumption is].
HTH.
751 views ·
1 of 6 answers
Something went wrong. Wait a moment and try again.