Live data from Hacker News

Using LLMs to enhance our testing practices

assembled.com

81–82 of 82 posts

Re: Using LLMs to enhance our testing practices

#81
post #60

Earlier quoted context omitted.

I subscribe to the concept of the "pyramid of tests" - lots of simpler unit tests, fewer integration tests, and very few end-to-end tests. I find that using LLMs to write unit tests is very useful. If I just wrote code which has good naming both for the classes, methods and variables, useful comments where necessary and if I already have other tests which the LLMs can use as examples for how I test things, I usually…

I also subscribe to a testing pyramid but I think it's commonly upside down IMO. You should have a few very granular unit tests for where they make the most sense (Known dangerous areas, or where they are very easy to write eg. analysis) More library/service tests. I read in an old config file and it has the values I expect. Integration/system tests should be the most common, I spin up the entire app in a container a…

This is exactly my experience.

Re: Using LLMs to enhance our testing practices

#82
post #79

Earlier quoted context omitted.

Set aside LLMs, why does mutation testing need to be fast? It would be fine to have mutation tests run slowly, out-of-band of the main CI pipeline. They aren't mission critical, they're smoke tests for your unit tests. Also you only need to generate a set of mutations for any particular unit once, and then again when the test code or the code under test changes.

Because mutation testing (should) generate a lot of mutants, which you then need to run your unit tests against.

Yes but my point is it doesn't have to do that fast, as in unit test speeds.
Post reply on HN