3 ms·
Don't see the top comments mentioning that, so I will chip in: I always, whenever possible, try to reproduce the bug in tests first, before launching debugger /
by gedrap 11y ago
Don't see the top comments mentioning that, so I will chip in: I always, whenever possible, try to reproduce the bug in tests first, before launching debugger / adding some statements, etc.
Being able to quickly reproduce the bug time and time again makes a big difference. Some permanent verification that it's actually fixed (at least in the given case) at the end of the session is also nice and adds a lot when doing a major refactoring or something similar. Especially for bugs related to the domain specific requirements, rather than the technical ones.
- wlievens 11y agoI actually use that as an interview question: "A user reports a bug. What do you do?". Ideally they mention "writing a failing test" somewhere before "fire up the debugger". It depends strongly on the circumstances of course.