Remix.run Logo
▲ theoli a day ago

The problem with not reading tests is that you don't know if the test really does what the name implies.

I'll immediately riposte against my own statement that this is a small and continuously shrinking problem with LLM generated tests.

Still, if you have a test called transaction_cancellation_reverts_charges_on_all_accounts, and if you have not read the body of the test and confirmed that it indeed tests this, it is a less useful test. I have caught these kinds of errors created with frontier models and in the past few months. The more complex the logic under test, the more likely this problem is.

I am tempted to be of the opinion that an unverified test is equivalent to no test. But in reality I see that having lots of unverified / not-reviewed tests still adds beneficially to coverage and bug prevention. I just hate the feeling of not knowing which tests might be lies. I try to always do a review of tests that "smell" like they are complex enough for an LLM to mess up implementing.

▲hgomersall 21 hours ago | parent | next [-]

I think the trick is to care when it matters. Pre LLMs I would typically test the stuff that really needed testing very carefully, say a gnarly algorithm that proceeds through lots of state, and do so in a way that really helped confidence in the implementation. Then there are tests that are pretty trivial checks on pretty trivial functionality that often fell by the wayside. Now those trivial tests are easy to fill in completely, including all the corner cases, and are often pretty easy to check. What would have taken days to complete can now be done in minutes plus a sanity check review. I don't think we can get away from the important tests yet though.

▲XorNot 17 hours ago | parent | prev [-]

Except my code reading objectively sucks. Otherwise AI wouldn't have found numerous bugs in my existing code.

Honestly reading the code is a lot less important then doing the in-person QA: actually using the product and testing the output. The tests are there to keep the AI on track but they can't tell you whether the actual thing you're trying to accomplish works.

▲theoli 15 hours ago | parent [-]

AI has found loads of bugs in code I have written and reviewed over the years, it's pretty humbling really. But very, very few of these bugs it finds were "likely" to create real production problems, while AI generated bugs sometimes are standing in the middle of the road so-to-speak.

> actually using the product and testing the output

This seem like an interactive application perspective. Some code I write processes millions of records in batch processing. It's an amount that is impossible to review the output of by hand, or even a representative sample. In these cases it makes sense to scrutinize AI generated tests and lean on strengthening that code reading and leveraging peers.