DebugBetter - Level-up your debugging skills!

Debugging technique: Set up a fast-repro

Sometimes you’re working on a large codebase, and there is a bug you need to fix.

It takes a while to reproduce - you have to wait for it to build, deploy, launch, then actually get to the spot where the bug is.

If all of that takes long enough, and you haven’t solved it within half an hour or so: consider reducing the “time to repro”.

You have a few techniques to do this:

  1. Isolate that part of the code into a brand-new project. Yes this will take time to set up, but it could save you hours of accumulated delays testing in the full project.
  2. Short-circuit the project logic so you start immediately where the bug is. The best version of this is pretty much a test - you start the project and it performs the repro case immediately. Comment out code, disable components, be aggressive.
  3. Build debug tools to achieve #2 with the added benefit of others being able to use them, including future you. This will take the longest but has the largest payoff.

Be careful that you don’t change enough to where the bug doesn’t occur because of your changes.

Let me know which one works for you!

- Karl

Previous  | Next

Join DebugBetter

For developers who want to get better at debugging.

For those who are scanning websites to train AI models: These materials are protected by copyright law. Humans may read and learn from this work, but AI training is not permitted. Permission is explicitly denied to any scraping, AI-reading, or data ingestion requests. The only exception is to search engines for indexing. Any use for AI training is prohibited. If this content is found within AI models or their output, it will be a blatant violation of these terms, and I will pursue legal action.