Questions tagged [debugging]
Debugging is the process of examining the state of a program - generally with a debugging tool - while it is running and attempting to find bugs that cause it to behave abnormally.
254 questions
283
votes
22
answers
53k
views
Leaving intentional bugs in code for testers to find
We don't do this at our firm, but one of my friends says that his project manager asked every developer to add intentional bugs just before the product goes to QA. This is how it works:
Just before ...
169
votes
9
answers
30k
views
I changed one method signature and now have over 25,000 errors. What now?
I started a new job recently where I am working on a very large application (15M loc). In my previous job we had a similarly large application but (for better or for worse) we used OSGi, which meant ...
127
votes
16
answers
28k
views
Is there any way to get faster at solving bugs? I've just had a warning from my boss [closed]
I've just been told by my boss that I will receive a negative performance review on Monday. He wants to talk to me about why I am so slow and why my bug fix rate is so low.
I love programming and ...
107
votes
21
answers
23k
views
What's the benefit of avoiding the use of a debugger?
Over the course of my career, I've noticed that some developers don't use debugging tools, but do spot checking on erroneous code to figure out what the problem is.
While many times being able to ...
71
votes
17
answers
10k
views
Is it reasonable to insist on reproducing every defect before diagnosing and fixing it?
I work for a software product company. We have large enterprise customers who implement our product and we provide support to them. For example, if there is a defect, we provide patches, etc. In other ...
65
votes
5
answers
21k
views
Why is reverse debugging rarely used? [closed]
gdb implemented support for reverse debugging in 2009 (with gdb 7.0). I never heard about it until 2012. Now I find it extremely useful for certain types of debugging problems. I wished that I heard ...
64
votes
9
answers
12k
views
How do you debug without an IDE? [closed]
Every time I look for an IDE (currently i'm tinkering with Go), I find a thread full of people recommending Vi, Emacs, Notepad++ etc.
I've never done any development outside of an IDE; I guess I've ...
58
votes
12
answers
7k
views
How to test the tests?
We test our code to make it more correct (actually, less likely to be incorrect). However, the tests are also code -- they can also contain errors. And if your tests are buggy, they hardly make your ...
57
votes
21
answers
11k
views
"It was working yesterday, I swear!" What can you do? [closed]
When you arrive in the morning, you find that your software does not work anymore, even though it did when you left yesterday evening.
What do you do? What do you check first? What do you do to stop ...
49
votes
17
answers
52k
views
How to check or assess debugging skills of a person? [closed]
What kind of skills determine a person that is capable of debugging code with ease? Some time ago my friend carried out an interview with a relatively good programmer. The programmer got hired. He ...
45
votes
7
answers
4k
views
Does software testing methodology rely on flawed data?
It’s a well-known fact in software engineering that the cost of fixing a bug increases exponentially the later in development that bug is discovered. This is supported by data published in Code ...
41
votes
8
answers
10k
views
Should debug code be left in place, always, or added only when debugging and removed when the bug has been found?
I, for one, only add debug code (such as print statements) when I'm trying to locate a bug. And once I've found it, I remove the debug code (and add a test case which specifically tests for that bug). ...
38
votes
11
answers
9k
views
Concurrency: How do you approach the design and debug the implementation?
I've been developing concurrent systems for several years now, and I have a pretty good grasp on the subject despite my lack of formal training (i.e. no degree). There's a few new languages that have ...
37
votes
9
answers
8k
views
Is possible to write too many asserts?
I am a big fan of writing assert checks in C++ code as a way to catch cases during development that cannot possibly happen but do happen because of logic bugs in my program. This is a good practice in ...
35
votes
8
answers
36k
views
How to most effectively debug code? [closed]
Bugs creeping into code can be minimized, but not entirely eliminated as it is written - programmers are, although many would disagree, only humans.
When we do detect an error in our code, what can ...
34
votes
4
answers
72k
views
What is the correct way to handle debug output in Java?
As my current Java projects grow bigger and bigger, I feel a likewise growing need to insert debug output in several points of my code.
To enable or disable this feature appropriately, depending on ...
33
votes
4
answers
7k
views
I am spending more time installing software than coding. Why?
I am developing code mainly using Bash, C, Python and Fortran and recently also HTML/CSS+JavaScript. My OS is Ubuntu.
Maybe I am exaggerating, but I figured that I kind of spend more time getting ...
31
votes
3
answers
10k
views
What is the term for a 'decoy' feature or intentional bug? [closed]
I have forgotten a slang programming term. This thing is an intentional bug or a decoy feature used as a distraction. An example usage, "Hey Bob, QA is doing a review today. Put a $THING into the ...
30
votes
20
answers
3k
views
How do you tackle really bizarre errors that keep you puzzled for more than 10 hours? [closed]
You know them, those errors that make NO sense. Where it seems like a gremlin just jumped deep inside your chips and messed up something. Do you take a walk, write stuff, call an uncle?
29
votes
13
answers
8k
views
How to improve your ability to debug existing code [closed]
A common task in the working world is dealing with existing, but buggy code. What are some tips to improve your skills as a debugger?
27
votes
8
answers
6k
views
Split the calculation of return value and the return statement in one-line methods?
I have had a discussion with a coworker about breaking a return statement and the statement that calculates the return value in two lines.
For example
private string GetFormattedValue()
{
var ...
27
votes
2
answers
81k
views
How can I debug a JSP?
I'm trying to edit a JSP for a project and I'm getting a NullPointerException somewhere in the JSP when it's requested from my server.
My web server (JBoss) is reporting the exception, but it's ...
26
votes
13
answers
2k
views
Does the use of debuggers have an effect on the efficiency of programmers? [duplicate]
Possible Duplicate:
Are debugging skills important to become a good programmer?
I'm a young Java developer and I make a systematic use of the Netbeans debugger. In fact, I often develop my ...
26
votes
7
answers
3k
views
What's the best way to avoid catastrophe caused by negligence? [duplicate]
I have been a programmer for almost 1 year.
As an ADHD adult, naturally I don't have the same strength of attention on ordinary stuffs as my colleagues do.
And I find the catastrophe made by me are ...
26
votes
10
answers
2k
views
Why do new programmers seem to ignore compiler error messages/runtime exception messages? [closed]
I think we’ve all seen this. Beginners ask questions on Stack Overflow that follow the basic outline...
I’m trying to do (very vague description of the goal) but it doesn’t work/I get an error/...
26
votes
7
answers
21k
views
What do you look for when debugging deadlocks?
Recently I've been working on projects that heavily use threading. I think that I'm OK at designing them; use stateless design as much as possible, lock access to all resources that more than one ...
25
votes
7
answers
7k
views
Can abstractions and good code practice in embedded C++ eliminate the need for the debugger?
I am a C developer for an embedded system. YouTube has recently started recommending "C++ for embedded systems" talks. Having watched some of them, they pique my interest, but none of them answer the ...
24
votes
16
answers
9k
views
Are debugging skills important to become a good programmer?
Along with the other qualities should a programmer need good debugging skills? If I have an applicant who was not able to find the error in the given program, but was able to solve all puzzles and ...
24
votes
13
answers
5k
views
Becoming a Better Bug-Fixer
I love being a programmer. There, I said it. However, with that said, I've realized lately that I really can't stand bug-fixing. At all.
In fact, while I'm developing something, my productivity is ...
24
votes
5
answers
30k
views
Debugging memory corruption
First off, I do realize this is not a perfect Q&A style question with an absolute answer, but I can't think of any wording to make it work better. I don't think there is an absolute solution to ...
24
votes
3
answers
9k
views
How can I diagnose async/await deadlocks?
I am working with a new codebase that makes heavy use of async/await. Most of the people on my team are also fairly new to async/await. We generally tend to hold to Best Practices as Specified by ...
23
votes
12
answers
3k
views
Is fixing bugs made by other people a good approach?
Let's assume the situation where a team of four developers is building an application. During the testing phase, bugs are reported by users. Who should fix them? The person who committed the erroneous ...
22
votes
12
answers
6k
views
Is it significantly costlier to fix a bug at the end of the project?
In a blog post by Andrew Hay, the following axiom was posited:
It costs significantly more to fix a bug at the end of the project that it does to fix the same bug earlier in the project.
However, ...
22
votes
4
answers
6k
views
How do AI developers for LLM fix bugs when the LLM misbehaves, given that they cannot control what the LLM learns from the data?
The traditional non AI software with if-then-else and loop statements can be fully controlled. In contrast, machine learning software behaviour is unpredictable since the developer cannot control what ...
21
votes
5
answers
2k
views
How did they debug segmentation faults before protected memory?
Now, when I make a programming mistake with pointers in C, I get a nice segmentation fault, my program crashes and the debugger can even tell me where it went wrong.
How did they do that in the time ...
20
votes
5
answers
22k
views
When should a database table use timestamps?
First a note, I thought maybe this question belonged in the database exchange, but I think it is more broadly related to a programming solution as a whole than to databases. Will move to database ...
19
votes
10
answers
3k
views
Why not use the word bug instead of exception? [closed]
If we refer to exceptions as bugs, why not just call it a bug in the first place instead of an exception?
If in the code it's called exception and as soon as it occurs it's called a bug. Then why not ...
19
votes
11
answers
6k
views
Code readability and debugging
Sometimes, I have a hard time deciding between two good code traits: debuggability and readability. The snippets below are an oversimplification, but they illustrate my pain.
Example 1:
if(...
18
votes
9
answers
3k
views
How common are "bandage" fixes? [closed]
Imagine the following scenario:
You've detected that your (or someone else's) program has a bug - a function produces the wrong result when given a particular input. You examine the code and can't ...
18
votes
3
answers
6k
views
How does GDB pause an execution
As you may know, we can use GDB and set breakpoints on our code to pause execution for debugging.
My questions is, how does GDB pause a process and let you view the content of registers using i r for ...
18
votes
1
answer
2k
views
Dollar Sign Blues: Javascript and PHP
I grew up programming C++ and Java where everything was safe and beautiful. Compilers made sure to keep me in check if I ever strayed. Of course, everyone did a little Perl in college, but I didn't ...
17
votes
4
answers
2k
views
How do I isolate difficult to reproduce bugs? [duplicate]
There's a bug in my program. Doesn't really matter what the platform is. Every so often, a row in a ListView is the wrong color. I tried setting a watchpoint for the variable that is supposed to ...
17
votes
2
answers
26k
views
Debug multiprocessing in Python
What are some good practices in debugging multiprocessing programs in Python?
16
votes
15
answers
17k
views
Real programmers use debuggers? [closed]
If experienced programmers actually ever use debuggers, and if so under what circumstances. Although in the answer to that question I said "months" ago I probably meant "years" - I really don't use a ...
16
votes
7
answers
916
views
Bug once in a while, but high priority
I am working on a CNC (computer numerical control) project which cuts shapes into metal with help of laser.
Now my problem is once in a while (1-2 times in 20 odd days) the cutting goes wrong or not ...
16
votes
4
answers
28k
views
What is a zombie process or thread?
What is a zombie process or thread, and what creates them? Do I just kill them, or can I do something to get diagnostics about how they died?
16
votes
6
answers
3k
views
Time estimating of a complex bug investigation (not a straight-forward one) [duplicate]
(It is not a duplicate: Bug investigation is much more non-deterministic than a defined development task where things to be done are specified. Investigation is about narrowing a huge search space, ...
15
votes
16
answers
3k
views
How to spend less time on debugging? [closed]
Following the Pareto rule, a programmer spends only 20% of his time for really useful things.
I spend 80% of my time debugging, fixing small things to get everything working.
Is there a way to spend ...
15
votes
11
answers
819
views
How to teach your users/customers to send better error descriptions
I often have to deal with customers or users which are reporting errors in applications.
Most of the time their content is something useless as
ERROR!!!
x does not work
without much more information.
...
15
votes
8
answers
6k
views
What process do you normally use when attempting to debug a problem/issue/bug with your software? [closed]
Most people seem to treat debugging as an art, rather than a science. For those here which treat it as a science, rather than an art - what process(es) do you normally use when faced with a new issue/...