How do you isolate whether a bug is caused by software logic, hardware failure, or environmental interference?