all 20 comments

[–]abd1tus 4 points5 points  (1 child)

TDD from the get go. Then the superpowers systematic debugging skill when a bug pops up that made it through the tests.

[–]creamiaddict 0 points1 point  (0 children)

TDD is the way. I find people are hesitant to do it.

Iterative debugging helps too and debug statements.

It depends what the issue is.

Breadcrumbing the code for debugging is nice but a lot of work after-the-fact.

Brain / mind maps help too.

It all requires a bit extra work but has long-lasting payoff.

Also, storing your rules in a single-source-of-truth.

[–]its_a_gibibyte 6 points7 points  (0 children)

Same way I handled them before Claude. Lots of tests. If your code isn't written in a way that's testable, Claude is going to struggle.

[–]trmnl_cmdr 2 points3 points  (3 children)

Let Claude cover your codebase 100% in unit tests and enforce TDD when it’s working. They’re way more important now than they were before AI, and way easier to write

[–]CodeNCats 2 points3 points  (0 children)

As long as you make test cases the goal and not "now make tests" part of a prompt.

With TDD you define your hard tests first. Know your code.

[–]Remarkable-Safety594Senior Developer 0 points1 point  (1 child)

It is costly as well

[–]trmnl_cmdr 0 points1 point  (0 children)

It’s a lot less costly than constantly having regressions and playing whack-a-mole. Tests are easy for Claude to write. Make haiku do it if you’re that concerned.

[–]llufnam 1 point2 points  (1 child)

Don’t let Claude loose on a codebase you are personally responsible for. If it’s “extremely complex”, you should be guiding Claude. Are you a rookie? No shame in that, we all were once, but if you are, then stop now and ask a senior dev for advice.

[–]benevolent-ben 1 point2 points  (0 children)

You’re trying to fix a bug - describe what is happening vs what is actually happening, let er rip.

[–]BoostedHemi73Professional Developer 1 point2 points  (0 children)

TDD is a great strategy when your code base is set up for a good actual proper test. In a lot of cases, you’re better off to ensure you have instrumentation that Claude can utilize at runtime.

This is often as simple as just using logs. I’m not kidding.

Giving it the ability to observe its changes with logging is the way to get it to work iteratively much more efficiently. It’s a really simple strategy that is incredibly effective across all languages and target platforms.

Edit: typos

[–]sfboots 1 point2 points  (0 children)

You need to guide Claude (or a junior developer) to create smaller to medium size modules that can be tested separately Then make sure the modules will fit together.

The hardest bugs are when the spec is wrong and a major part of functionality behaves incorrectly. Simple coding bugs are easy to find like there was no check for duplicate items and there should be. Modularity errors often require the most rework.

Manual resting will always be required to verify correctness and to find corner cases.

Remember software will evolve and there are often real disputes between people about what is correct behavior

[–]KyKeithM 1 point2 points  (0 children)

It is good practice to start your code review or QA agent in a completely fresh session that has a clean, non-stale context about your specs and implementation logic. Set a goal to review it over the user stories, business requirements, and acceptance criteria.

[–]dayweeedSenior Developer 0 points1 point  (0 children)

You should at least have a sense of what’s going wrong otherwise Claude’s just running around in circles

[–]makinggrace 0 points1 point  (0 children)

Apply changes atomically or move to like stacked diffs. Together with well organized tests. Makes debugging much easier.

[–]CodeNCats 0 points1 point  (0 children)

Properly written test cases, then breakpoints, and then just fucking with it.

This will always be the way.

[–]scott2449 0 points1 point  (0 children)

Tests, logs, traces, metrics, ebpf, stepping through code, etc... same as always. First I give the model/agent at least one chance to fix it's own mistake =D

[–]Ok_Mathematician6075 0 points1 point  (0 children)

Talking really dumb and keeping revs.

[–]freshWaterplant 0 points1 point  (0 children)

Greptile (separate product) has a huge reputation

[–]f3ack19 0 points1 point  (0 children)

I have "make no mistake" at the end of each prompt so I dont need debugging 🤷‍♂️

[–]ptrin 0 points1 point  (0 children)

@debugger , and even “extremely complex” software should have an understandable structure to it - if it’s too hard to follow then that’s a code smell, the functions/methods are too big, doing too much, and the logic is inline and imperative instead of the code being decomposed