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 dictate the color of the row, and it doesn't change... I am guessing it means the problem could be in the framework code. I've only witnessed it happen once.. My client has noticed it though, and wants it fixed. No idea where to start. Someone told me to artificially increase the load of the program.What are some methods for hunting down difficult to find bugs?
How do I isolate difficult to reproduce bugs?
debugging
Logging. Add a bunch of logging to the related module, set it to debug and get the user to send you a copy of the log when the error occurs again.If you can reproduce the error, set your logger to go to the console, and try to reproduce it. Look for anomalies that only occur when the colour is wrong. Back track. Find all references find any line of code that could possibly cause this issue. Then think about whether the code is doing what it should. Don't trust that your code works like you think it does. Challenge yourself - this variable should be set to x now test that it is. Set a conditional breakpoint. Or a print line. Or a log. Grab a friend. Do some pair programing, another pair of eyes may help you.Google the frame work, ask on SO, see if other people have had a similar issue. Maybe its not a bug in the framework, but a trap that people occasionally fall into.This is framework dependent, but in WPF you should display the output and look for binding errors. Go have a look over your clients shoulder. See if they are using the program in a different way to the way you test. Maybe they can reproduce it but aren't documenting their steps. Maybe you are assuming usage flow that is different to what the client is actually doing.Take careful notes, or even better run a screen recording programing. Once the bug occurs, restart the app, and follow exactly what you did before. if you can reproduce it then you're half way there.