Maxim Menshikov

Static analysis reseacher and startup founder


Cognitive load reduction as a debugging aid Thoughts

What are the biggest issues when debugging large projects?

At some point, you notice that these projects don’t obey to rules. It is often impossible to run these tools under a debugger to get a meaningful result. You get unreadable hundred millions log lines. Reverse debuggers are not useful either: the place where the bug appears is so far from the crash point that you might never really find it.

My advice in such cases is:

  1. Spend time and try to think of a possible error.
  2. Narrow the log down to the domain which, as you think, might be buggy. If possible, disable all other logging so it doesn’t consume priceless time.
  3. Simplify log: print inputs, outputs and actions done.
  4. Repeat until you find the error in function output.

This reduces cognitive load down to a minimum and allows to finally read all important actions.

This works best if the final execution takes under 1s, or at most 10s.