r/ProgrammerHumor • • Oct 20 '26

Meme claudeWasNotHere

Post image
18k Upvotes

230 comments sorted by

View all comments

Show parent comment

10

u/4xe1 Oct 20 '26

I find Test Driven Development to be great if you are addressing a real production issue and can reasonably recreate the failure scenario in your tests.

Is that TDD? The TDD people have the AI doing is writing tests before the very first line of code, and to implement new features, not merely fixing bugs on an existing product with users.

They do share methods and some of the associated benefits obviously, but what you describe sounds like just writing non-regression tests to me, not Test Driven Development.

8

u/helicophell Oct 20 '26

TDD is writing tests you know will fail, then writing/refactoring code that will pass said tests, then going back to write more tests for more features

Compiler errors are a form of TDD, like TypeErrors and Syntax errors

Everyone uses TDD in some form... most are just using the IDE to do it for them

6

u/dyslexda Oct 20 '26

AI uses TDD because it's the only way for it to know if something works or not. One shotting isn't anywhere near as good as folks might claim without TDD. The agent will write a test, write code, then run the test, realize the test fails, and try to treat that as a new debugging session. End user only sees the final result with passing tests. In other words, AI's tests aren't there for future use, they're a mechanism to mock up what devs themselves do (create a small part of a project, run it a few times until they're happy, then move onto the next).

4

u/Wonderful-Habit-139 Oct 20 '26

It's the best application of TDD. To prevent regressions. Outside of that TDD is pretty lousy, especially when you have Type Driven Development and are trying to figure out an elegant way of solving a problem. You might not know how the final API and code is going to look like ahead of time. And the "makes your code easily testable" is still easy to do when you define types and think in terms of functions and inputs/outputs.