Live data from Hacker News

Debug like a boss: 10 debugging hacks for developers, quality engineers, testers

ministryoftesting.com

11–20 of 29 posts

Re: Debug like a boss: 10 debugging hacks for developers, quality engineers, testers

#11
post #6

None of these debugging tips involve the use of a debugger, arguably one of the most efficient ways to debug.

In most production cases, there is no luxury of debugger.

In my current $job, all we get is logs from 70+ node cluster and that too in a shared-nothing architecture. You have to stitch together varied datapoints (job logs on multiple nodes, netstat o/p, job logs of other services, http access logs, tcpdump, etc) to even prove that problem is on the customer side and not ours.

Re: Debug like a boss: 10 debugging hacks for developers, quality engineers, testers

#13

It's pretty crazy the number of times I've banged my head against the wall trying to fix something... and then I'll either step away for an hour, or just come back the next day, and I'll have it fixed in minutes. It really does work sometimes.

I agree. The brain works in mysterious ways.

I remember playing a logic game which required lots of thinking to solve it. Then at some point I stopped trying to actively solve it, I just simply stared at the game without trying to solve it, and after a while I tried to solve it. Guess what? I solved it at first attempt, without knowing how! This was really curious and it made me excited so I tried to keep doing it this way and turns out it was not a fluke, this method seemed to work consistently.

I did some research on it and this phenomenon is called "incubation" which is a core concept in the psychology of creativity and problem solving. Apparently it's frequently observed in puzzles, mathematical problems, and design tasks that require restructuring rather than mere computation.

In your case, conscious and effortful thinking can lead to functional fixedness or mental set, where you become stuck on an unproductive strategy, so taking a break allows these rigid patterns to weaken, making space for more flexible or creative approaches.

Re: Debug like a boss: 10 debugging hacks for developers, quality engineers, testers

#14

It's pretty crazy the number of times I've banged my head against the wall trying to fix something... and then I'll either step away for an hour, or just come back the next day, and I'll have it fixed in minutes. It really does work sometimes.

I agree. The brain works in mysterious ways. I remember playing a logic game which required lots of thinking to solve it. Then at some point I stopped trying to actively solve it, I just simply stared at the game without trying to solve it, and after a while I tried to solve it. Guess what? I solved it at first attempt, without knowing how! This was really curious and it made me excited so I tried to keep doing it th…

(for those interested in reading more about this...)

https://en.wikipedia.org/wiki/Incubation_(psychology)

    In psychology, incubation refers to the unconscious processing of problems, when they are set aside for a period of time, that may lead to insights. It was originally proposed by Graham Wallas in 1926 as one of his four stages of the creative process: preparation, incubation, illumination, and verification. Incubation is related to intuition and insight in that it is the unconscious part of a process whereby an intuition may become validated as an insight. Incubation substantially increases the odds of solving a problem, and benefits from long incubation periods with low cognitive workloads.

Re: Debug like a boss: 10 debugging hacks for developers, quality engineers, testers

#15

It's pretty crazy the number of times I've banged my head against the wall trying to fix something... and then I'll either step away for an hour, or just come back the next day, and I'll have it fixed in minutes. It really does work sometimes.

But you can't just step away. A certain amount of headbanging (and desperation or anger) is needed to trigger your brain background processing.

Re: Debug like a boss: 10 debugging hacks for developers, quality engineers, testers

#16
When I started programming debuggers were very good. Windbg for example was incredibly powerful, you could debug the Windows kernel, boot process, run scripts, author plugins, anything.

And yet here decades later this list about debugging doesn't even mention a debugger, and in many environments they are worse and harder to use than what we had before. I'm so disappointed!

Re: Debug like a boss: 10 debugging hacks for developers, quality engineers, testers

#18
post #6

None of these debugging tips involve the use of a debugger, arguably one of the most efficient ways to debug.

The article has slop slurping all over from it

The article is a bit of a "dog bites man", but itsobservations are valid. False assumptions are what caused > 50 per cent of my bugs, and for bugs in production, reasonable logging is what you need. The point with going away from the computer and letting your brain process things is good too, and the point about postmortem is spot on. I hate it when my colleagues say "fixed" without explaining how the error emerged in the first place, and they mostly already learnt to supply context to correction of non-trivial bugs. (I try to lead by example and send detailed e-mails after major fixes.)

Re: Debug like a boss: 10 debugging hacks for developers, quality engineers, testers

#19
post #6

None of these debugging tips involve the use of a debugger, arguably one of the most efficient ways to debug.

"But I can just add print statements" is the bane of my existence.

If they really insist then I encourage them add trace logging instead so at least it's not wasted effort.

Re: Debug like a boss: 10 debugging hacks for developers, quality engineers, testers

#20
Generally speaking, I still like the old-school idea of recreating the buggy production environment in dev environment by export/import of production data to dev env and debug from there. However, is the problem occured in a SaaS web applications, there are modern cloud logging tools that can help. I found and used Posthog lately and it records user activity on the go, and can even record videos of your web application while it runs and is used by customers. This way you can have both text logging and video logging. Maybe it can be useful to somebody. The good thing about posthog is that it's not difficult to stay inside their free tier
Post reply on HN