Hacker News new | ask | show | jobs
by egonschiele 22 days ago
In a similar vein, here's my favorite prompt: "Please review the tests you've written. Will the tests actually test what they're meant to? If the code breaks, will the test fail?" It's amazing how often LLMs will write tests that don't test anything.
2 comments

I've seen a lot of human-written tests that wind up testing the testing framework and not the actual code.
yeah but it'll be one or two at a time that you find like that. LLMs will output two dozen tests for one line of real code, where you maybe needed one
My workflow is: - Write the test first, confirm it fails - Write the minimum code to make that test pass - Confirm it is green
TDD like this is a very good system for a lot of things, especially brownfield development - gotta make sure you understand the error space before you know you’ve fixed the error. :D