DEV Community

Cover image for 5 Debugging Tips that can Save you 5hrs of Debugging Time
Osarumense Idukpaye
Osarumense Idukpaye

Posted on

5 Debugging Tips that can Save you 5hrs of Debugging Time

1. Document Everything

You should always document everything from instructions on how to replicate the bug, to defined strategies on how to resolve the bug, to any side effect that results from a solution implementation. This is probably the most important one and I learnt this from working at Loxe Inc.

2. Error Logging

Always log your errors through a properly implemented error handler middleware and when an error occurs be sure to check your logs. I don't also forget the remove log statements from your debugged code. I learnt this from working at Loxe Inc.

3. Only refactor working code

When debugging it is best to work with the most simplistic-looking code piece of code to speed up the refactoring process and refactor after the code has been debugged.

4. Fix one problem at a time

This is also one major mistake most people make including myself of trying to resolve all the bugs at the same time before testing or grouping a lot of small bugs into one big bug, never do this. Always fix one bug at a time

5. Take Breaks

This can be linked to the spacing effect which refers to the finding that long-term memory is enhanced when learning events are spaced apart in time, rather than massed in immediate succession.
What this translates is that when trying to resolve bugs don't feel that you have to do it all in one go. it's okay to take breaks while resolving a bug.

Top comments (0)