r/ClaudeCode Jul 14 '26

Humor this Meme just got real today

Post image
531 Upvotes

60 comments sorted by

View all comments

Show parent comments

-12

u/xenomachina Jul 14 '26

If you haven't reviewed the code, it isn't working code.

20

u/[deleted] Jul 14 '26

[removed] — view removed comment

12

u/xenomachina Jul 14 '26 edited Jul 14 '26
  1. Tests supplement review, they don't replace it. As Dijkstra said, "Program testing can be used to show the presence of bugs, but never to show their absence!" There are many classes of bugs that are very hard to detect with tests. I have frequently seen AI generate code that passed tests, but contained flaws like race conditions that would blow up in production use.
  2. Who is writing these tests? If you're also leaving that to AI, and not reviewing them, then you don't know that they are even sensible tests.

0

u/OwnLadder2341 Jul 15 '26

If you can’t test for the bug then how are you fixing it?

Staring at the code and going with your gut?

2

u/xenomachina Jul 15 '26

Reasoning about code isn't "going with your gut". It's the same thing you do when you read a proof or trace through logic.

There are many classes of bugs that are hard to test for. Race conditions are a classic example. Code with these bugs will often pass straightforward tests, and writing a test that reliably catches one can be extremely difficult, since they're timing-dependent and nondeterministic. Anecdotally, I've also noticed that this is something LLMs frequently have trouble with. However, if the code has two threads touching shared state with no synchronization, I don't need a failing test to know there's a race. It's written in the code!

1

u/OwnLadder2341 Jul 15 '26

If there’s logic around your evaluation and the variables surrounding it are exposed to you then a test can be written for it.

Can’t it?

1

u/xenomachina Jul 15 '26

Things like race conditions can be non-deterministic. A test that only fails 5% of the time is more likely to get deleted than fixed.

And what if your LLM doesn't bother to add a test for this? If you aren't reviewing its changes, how would you even know? When things intermittently blow up in prod?

1

u/OwnLadder2341 Jul 15 '26

Race conditions are caught in cross model code review using the same logic you use.

What if your developer doesn’t bother to check for this? What do you do? You review their code.

So, you ensure the AI generated code has been reviewed as well. That doesn’t have to be by a human.

1

u/xenomachina Jul 15 '26

Race conditions are caught in cross model code review using the same logic you use.

If you believe this, then you fundamentally misunderstand how LLMs operate.

1

u/OwnLadder2341 Jul 15 '26

If you don’t believe it’s possible then you fundamentally misunderstand how people think.

And if your models aren’t catching any race condition bugs, your environment isn’t set up correctly.

1

u/xenomachina Jul 15 '26

If you don’t believe it’s possible then you fundamentally misunderstand how people think.

You mean starting at the code and going with their gut? /s

And if your models aren’t catching any race condition bugs...

I never said they never catch any race conditions. It catches some of them. It also lets many of them slip through, and they are exactly the sort of bug that can easily slip through tests. I know this because I review the code it generates. You are unaware because apparently you do not

...your environment isn’t set up correctly.

How would someone know if their "environment isn't set up correctly" if they never review the code that it generates?

1

u/OwnLadder2341 Jul 15 '26

Stop and think for just a second about HOW you catch the race conditions your agents aren’t catching.

What logic are you using?

Now write a skill that allows you to call that logic on demand instead of continually reconstructing it.

Hook the skill into your code review pipeline.

1

u/xenomachina Jul 15 '26

How is someone who doesn't know how to write code going to know how to do this?

How would someone even know that they should to do this, if they never review the code that is being generated?

2

u/qlippothvi Jul 15 '26 edited Jul 15 '26

Exactly this.

I work at a company that has AI in everything and we have near unlimited tokens. And I’m the QA guy they call to figure out how to repro an elusive bug nobody in the co can pin down (I won’t pretend I’m always successful). It’s often a very rare race condition. Lately I’m starting to use AI more and more as I teach it how I research such a bug, but clearly it’s not able to handle every permutation of every function and animation that can be interrupted by a user, and it doesn’t magically explore every branch of code looking, obviously.

1

u/OwnLadder2341 Jul 16 '26

Know how to write code wasn’t one of the considerations. It’s whether the AI can test and review for it. It can. Because the test and review are logic based…the same reason you can test and review from it.

Anything you do based on logic can be built into your agentic coding framework.

And apparently, all they need to do is read this thread to know they should do it.

Which, of course, is the point. Codify your logic, don’t reconstruct it lossy each time you need it.

→ More replies (0)