Remix.run Logo
A new era for software testing(antirez.com)
90 points by Chrisszz 4 days ago | 27 comments
rglover 3 hours ago | parent | next [-]

> I have the feeling that the introduction of automatic QA may raise the bar of quality for new releases of software, and maybe partially compensate for the lower quality of the code produced at high speed with the use of automatic programming.

In theory. The only difference between today and "the aughts" is that we have machines that can spit out a ton of code very quickly.

Nothing has changed about the discipline or honesty around testing (you can skip automated tests even faster now if you wish). You can and should work with AI to write tests, but you have to know the difference between a good test and a "looks good on paper" test in order for it to truly be effective and raise the quality of what you're building.

onlyrealcuzzo 15 minutes ago | parent [-]

> I have the feeling that the introduction of automatic QA may raise the bar of quality for new releases of software, and maybe partially compensate for the lower quality of the code produced at high speed with the use of automatic programming.

I've been building a compiler with LLMs for a memory safe language like Rust with near zero cost abstractions (no GC), but with WAY less cognitive overhead.

I can tell you right now:

1) It's 100x more than I could have achieved with zero compiler design experience.

2) I'm HIGHLY skeptical that LLMs can build something of this complexity (in some ways it's more difficult than implementing a Rust compiler) - so the testing is quite robust - 3 different systems (unit, integration, fuzz tests) each with mutant testing, each with between ~65-90% line coverage and ~50-80% branch coverage, combined with ~99% line coverage and ~86% branch coverage.

There is ZERO chance I could get something even close to this level of "working" by myself ever - let alone with minimal effort.

The test is kind of simple - if LLM's can do this... They should be able to do just about anything... Compilers are notoriously difficult to verify they actually work, rather than just kind of work sometimes...

People can say I'm wasting my time all they want.

But, one, it's been enlightening. I'm literally in awe of what they can do and have done.

Two, I've developed a bunch of tooling / metrics necessary to get them to be able to do something at this level of complexity without falling over themselves. And I think it can work at scale pretty easily.

Nearly all of the research comes from the 80s or farther back for the complexity metrics.

mlmonkey 3 hours ago | parent | prev | next [-]

Writing unit tests used to be the bane of my existence. I used to hate them. Often times, the LoC for unit tests was 3X the LoC of the actual code.

But not any more! Now I point the LLM to the code and order it to write unit tests, covering all edge cases, etc. I'd rather spend 3 hours arguing with the LLM than writing unit tests! :-D

dkn 2 hours ago | parent [-]

I am curious in your experience how often the LLM must also update the tests. I find that if LLMs write tests after the implementation exists, they are either extremely brittle because they are coupled to the implementation, or they cover little of value because they mock everything to the point of testing nothing.

mplanchard 40 minutes ago | parent | next [-]

I have found a decent trick to be to write a parameterized test with e.g. a `cases` array that tests a function how you want it tested. Then ask the LLM to fill out more cases. It’s not perfect, but results in much less brittleness since you’ve already defined the specifics of what gets tested and what doesn’t.

dcastm an hour ago | parent | prev [-]

Same for me. I actively ask the LLM to write as few tests as possible. Otherwise you end up redundant and low value ttests.

dkn an hour ago | parent [-]

Yep, and wasted token spend on an ongoing basis.

I instruct the LLM to follow TDD practices in certain areas, but otherwise prioritize integration style tests at the edges.

avensec an hour ago | parent | prev | next [-]

> The idea is to create a markdown file where an AI agent is asked to work as a QA engineer

Given your code-base is mature enough, please don't have a single Skill/Steering/Persona/Ruleset (or whatever) for your "QA Engineer." This is just the same "my behavioral file can one-shot the entire system build" kind of thinking that will give you expensive, marginal results as the system grows.

If you want to have success in this space, get really fine-grained. Every single test scope needs its own behavioral files.

Have your core behavioral file define some simple specifics around Test Pyramid, Test Purposes, checks for tautological tests, etc. Then get _really_ specific;

<test-type>-architect (plan)

<test-type>-engineer (execute)

<test-type>-resolver (problem solver, maintenance, how to manage a failure, etc.)

e.g., playwright-architect, etc.

Then create additional ones for Unit tests, API tests, contract tests, or any other required test layer for the SUT.

Overengineered? Maybe given the size of your codebase. But for anything significant, you are codifying what humans and their skillsets do.

simianwords 4 days ago | parent | prev | next [-]

Scenario testing is the new word for it and I think this is a game changer.

Two of the reasons I never liked writing tests is

- they didn’t seem to usually assert much internal logic

- they would have to be maintained along with the original code

I think scenario testing is much better instead because the actual way a person uses a feature hardly changes but the internals might change a lot.

So imagine I’m making an e-commerce website. There are lots of internal mechanisms. I’ll have an agent testing all the functionalities as if it were a customer. This gives me much much more confidence while writing code because it is more uncorellated with the code.

Tomorrow I can change a lot of internals but the testing agent stays the same.

There’s something to note though: not all code is possible to be scenario tested. Like data engineering and other things where the feedback time is huge.

anthonypasq 4 hours ago | parent | next [-]

are we just re-inventing playwright tests except 10x slower and infinity times more expensive?

i feel like im going insane

righthand 19 minutes ago | parent | next [-]

Well playwright tests used to be called puppeteer tests which used to be called selenium tests, so you tell me.

hugs 3 hours ago | parent | prev [-]

since the rise of agentic coding tools, it feels like we're in a new "eternal september" of people discovering ui end-to-end test automation.

acdha 3 hours ago | parent | next [-]

Also the merits of documentation and specs. It’s been eye-opening to see the subset of developers who were almost disdainful about writing documentation for their colleagues but are now tripping over themselves to do so for their clanker.

simianwords an hour ago | parent [-]

Clanker is the new excuse to use hard R against something you don't like.

inigyou 3 hours ago | parent | prev [-]

People are rediscovering everything. Some people have proposed using a more formal language to tell the AI precisely what code to write. That's a compiler.

avensec 2 hours ago | parent | prev | next [-]

So, throw out the traditional test pyramid, shift right, and rely more on persona testing than fine-grained atomic tests? I would hope teams don't need to re-learn that lesson for themselves, but...

righthand 22 minutes ago | parent | prev | next [-]

This already exists. You mean capturing user flows which should already be supplied by product to the developer. A decent system is Behavior Driven Development (though honestly a poor acronym for it’s use).

konart 3 hours ago | parent | prev | next [-]

>Scenario testing is the new word

How is scenario different from a behavior (as in Behavior-Driven Development)?

Gherkin and things like Cucumber are not something new, are they?

hulitu 3 days ago | parent | prev [-]

> Two of the reasons I never liked writing tests

Are you an engineer ? You must test your "creation". Or would you expect that the microwave owen you just bougth will be tested by your child while getting burned ?

robotresearcher 4 hours ago | parent [-]

'I never liked writing tests' is not the same as 'I don't write tests'.

marshalhq 2 hours ago | parent | prev | next [-]

I ran mutation testing on a side project recently and found a test that passed even if the production method returned an empty string. AI-generated tests at scale will have exactly this problem. High coverage, confident test names, zero actual verification.

onemoresoop 2 hours ago | parent [-]

Don't worry, AI maximalists have a solution: create tests for the tests.

wesselbindt an hour ago | parent | prev | next [-]

The idea of injecting more indeterminacy in pipelines is beyond me.

devin an hour ago | parent [-]

Well you see, you just run the same test 10,000 times, and then...

wrxd 4 days ago | parent | prev [-]

I believe this can work if done on top of traditional testing. I would feel very uneasy to replace deterministic (ok, not always but mostly) test suites with something that is not deterministic at all

simianwords 4 days ago | parent [-]

I think this is just TDD or unit test dogma and I’m personally not a fan.

Unit tests and deterministic tests are hard to get right and need to be done at the correct boundary.

I have seen many people dogmatically pushing unit tests religiously but this often leads to very hard to maintain tests that mostly exist just to change along with the main code itself.

A good way to understand if your unit tests are good: are you changing them along with changing your actual code? Then it’s a bad test. I think the argument for “it’s just documentation” is weak.

fcarraldo 4 days ago | parent [-]

I don’t disagree with your point, but there is still value in having unit tests that change along with the code. It’s less than a “proper” test, but when these tests break _unexpectedly_, it’s still more signal than you’d have without them. Like, always changing `file.go` alongside `file_test.go` may be acceptable if you catch errors that impact `serve_test.go` unexpectedly.

Of course, if you’re just watching Claude changing both and saying “LGTM” then it’s not very valuable.