SP

Bugger: practicing the part after the code breaks

developer-toolssoftware-design

A broken program gives you a different problem from a blank editor. You need to work out what the code believes, where that belief fails and which change fixes the cause without breaking something else.

I built Bugger around that workflow. It is a browser-based debugging practice platform with small programs adapted from documented open-source defects. The current pilot covers Python, Rust, JavaScript and TypeScript. You start from a report and existing code, then investigate, edit and run tests.

Keep the failure mechanism

A production bug often arrives with too much context for a short exercise: a large repository, several services, environment setup and years of history. Removing all of that makes an exercise easier to start, but it can also remove the reason the bug was interesting.

The useful unit is the failure mechanism. A cached result can be confused with a missing value. A boundary case can violate an assumption that holds for ordinary inputs. A parser can behave differently when the same input arrives in several chunks. A repair should make that mistaken assumption visible.

Bugger uses original teaching programs rather than presenting an entire upstream application as a coding task. The source defect gives the exercise a concrete origin. The smaller program lets the learner spend time on the behavior rather than setup. Source-linked explanations connect that focused example back to its real-world context.

A cache can return the right value for the wrong reason

The homepage previews a challenge called “The cache that forgets.” Its central question is simple: why is a value being computed again after it has been cached?

Consider a cache lookup that returns None when a key is missing. If None is also a valid cached result, checking only the returned value cannot distinguish those two states. The code can produce the expected final result while doing the work twice.

That distinction changes the test. Checking the returned value alone misses the behavior that matters. A useful regression test also observes whether the repeated lookup causes another computation. The exercise is about identifying the contract of a cache, not memorizing a particular replacement line.

The same reasoning applies to other domains. Before writing an assertion, decide which observable behavior would prove the suspected failure. An output, a call count and a state transition answer different questions.

Make investigation the normal path

The practice loop has three parts. First, read the report and reproduce the symptom. Next, inspect the code and test a hypothesis. Finally, repair the cause and use the tests to check the change.

Reports and starter code can be browsed before signing in. Editing, saved drafts and remote execution are available after sign-in. Execution happens in an isolated remote environment, so a learner does not need to install each language toolchain just to try a challenge.

Hints are optional. An explanation becomes available after an accepted fix. There is no ticking clock or leaderboard. That makes room for the part that is easy to skip in a timed exercise: explaining why the original code looked reasonable and why it failed.

An accepted patch still needs an explanation

Passing a test suite establishes that a patch satisfies those checks. It does not establish that the learner can recognize the same failure in another codebase. That is why the root-cause explanation belongs in the workflow.

A useful reflection is short: what assumption did the code make, which input or sequence broke it and what invariant should remain true after the repair? For the cache example, separating absence from a valid null result is more reusable than remembering the exact syntax of the fix.

The same distinction matters when designing exercises. A test should reject the original defect and plausible incomplete repairs. An explanation should connect the test to the mechanism. Neither should depend on an incidental implementation detail when several correct repairs are possible.

What the pilot can establish

Bugger is a live pilot, not a claim that a certain number of exercises makes someone a better engineer. Difficulty labels are provisional. I have not measured transfer to unfamiliar production repositories or long-term retention.

The current product gives the learner a focused place to practice reproduction, hypothesis testing and regression prevention. Those are the behaviors I want the exercises to make easier to inspect.

You can browse the challenges or start with the cache exercise. Read the report first. Before changing a line, write down what you think is happening and which observation would show that you are wrong.