Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

There are instances which cane be seen while testing the application, both by developers and testers, some NullPointerExceptions arriving while clicking on a node in the table, or while doing an action too fast or under a zillion test-cases which do not come under the Test Cases document used in testing the application.

Most times we try to ignore these Ghosts ( i like Phantom bugs) which appear while testing. But the Quality assurance team won't be ready to accept a Phantom exception to occur while using the application. So what they do, they will file a bug along with the test case and the stack trace which occurred while the bug appeared.

When the developer tries to recreate the bug with all sorts of test cases and breakpoints everywhere the bug doesn't appear.

It feels like reading stories of UFO's spotted in some random area at some random time with a weird appearance.

How can a developer deal with these kind of issues before closing the bug or approaching the tester to recreate the bug which never can be recreated ?

share|improve this question

marked as duplicate by Frank, jk., gnat, Martijn Pieters, Kilian Foth Feb 13 '13 at 11:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
Does your QA have well defined test cases and can reproduce the bug? If necessary let the developer use their machine and then take all the data and settings used by QA. Your QA is right btw, those problems are even more likely to appear for customers with less well designed setups. You can't ignore bugs. –  thorsten müller Feb 13 '13 at 9:31
    
You might have found some time-relevant bugs. Maybe something is not yet initialized but if you wait a few ms, it is. Have you tried adding if-clauses to assure it's not null before you access the "phantom"-variable/function/class? –  mri Feb 13 '13 at 9:35

2 Answers 2

up vote 6 down vote accepted

Here's a few things you can do to increase your chances of reproduction:

  • use actual production data in your test case
  • reproduce the order in which actions occur in production (especially important for web applications where requests are sent asynchronously)
  • this may require increased logging in the deployed system, which is also a good idea on its own to find out where your two environments differ
  • reason backwards: why is this reference null? Was that supposed to be possible? If not, how could you be mistaken?
share|improve this answer
1  
+1 for reason backwards. Especially if it's a NullPointerException or a similarly localized problem, this can shed a light on wrong assumptions or forgotten side-effects. –  Joachim Sauer Feb 13 '13 at 10:05

To tackle ghost-bugs:

  • Insert logging.
  • Insert extra logging.
  • Insert even more logging.

Actually one of the main things I use to resolve ghosts bugs is removing dependencies and making sure that the part in your program where it occurs is as isolated from the rest as possible. This action would often resolve the issue.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.