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
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
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.