- Do not be afraid to read code (especially of others)
- Go as deep as possible to understand what is really happening under the hood
- Do not blame JDK or libraries
- 99% of the time, the bug is in something written by you
- Make assumptions, but do not trust yourself
- We might leave blind spots
- Walk away from the problem and come back fresh
- Take a break
- Do not write code without knowing what is being done
- Check JDK javadoc when not sure how a Java feature works
- Use proper log levels (info, warn, error, debug)
- Use breakpoints to have full view of program on particular point of application
- Conditions on breakpoints are important when debugging loop with thousands of values
- Use tools such as JMeter for load testing or jstack to capture thread dumps
- Have remote debugger for apps deployed on dev and pre-prod environments
- If any of the previous guidelines don't work
- Start eliminating code
- Check environment
- Check libraries