Binary search debugging.
- Find logical check points in your program. Example: for input 20, check point 1, should have a variable x value as 30. Check out 2, should have String str value as "high" and so on.
- Run the program and go to the middle of the check points and see if expected values are coming. If yes, proceed to the second half of the check point list, else to the first half.
- Repeat the process until you have just few lines of code left to debug.
PS: Using breakpoints is a good way to debug the code but i personally find it very time consuming and use breakpoints only sometimes.