1

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 ?

2
  • 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. Feb 13, 2013 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?
    – mhr
    Feb 13, 2013 at 9:35

2 Answers 2

6

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?
1
  • 2
    +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. Feb 13, 2013 at 10:05
3

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.

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