It's very handy to have around when working on tests for new modules, etc.
layer8 3 minutes ago [-]
I’m a bit skeptical of that approach. Tests can never catch all possible bugs, because tests can’t prove complete correctness of the code [0]. Only formal proofs can do that. Mutation testing therefore will always be able to come up with a new mutation that isn’t yet covered by the tests. So you will generally never have anything close to 100% mutation testing coverage, or even be able to express such a percentage.
It can probably still be useful for increasing test coverage in an interactive way, but the article doesn’t give any methodology to decide when enough is enough, or even for assessing the relative relevance of different mutations. So it’s a bit like poking around in the dark.
[0] except in the rare case that the possible inputs can be exhaustively enumerated in short finite time, such as testing a pure function taking a 32-bit integer as its sole input
kragen 37 minutes ago [-]
Claude Opus 5.5 has really gotten me into mutation testing. It's definitely a lot slower than normal regression testing (you have to rebuild and rerun your whole regression test suite on each mutant, so you don't want to do it as often) but it has had salutary effects on the quality of the regression test suite. I had occasionally done tiny amounts of mutation testing informally before, and I'd sometimes practiced "test-first" coding where I run the test before implementing the functionality, which is a very lightweight version of mutation testing, but now I'm doing it enthusiastically.
On the plus side, computers are faster now, so it's possible to run quantities of regression tests that would have been unthinkable 20 years ago.
Garlef 1 hours ago [-]
I think mutation testing is a great, great technique ~ But it takes a very long time to run!
(At least that was my experience with ts/js and stryker in 2021 where i last used it)
aleksiy123 10 minutes ago [-]
It is I run them outside the normal cicd process as a daily cronjob.
I would say results are mixed.
They do catch real bugs, but also are generally very noisy. Expensive/long to run.
Imo I think mutation and similarly fuzz testing are best applied selectively.
Work best on self contained, complex logic. Parsers, serialises, transforms that kind of thing.
hmartin 20 minutes ago [-]
It should get much faster once TS 7.1 comes out with the needed API's!
mac3n 4 days ago [-]
i hhave a vague memory of an article title something like "Hunting Plastic Animals" from the 1970s or 80s about mutation testing. "Plastic animals" being the artifically introduced bugs, and "hunting" by the test suites.
hungryhobbit 17 minutes ago [-]
The irony here is that AI makes this easier ... while also making it less valuable.
What I mean is, except for literal typos, bugs aren't generally caused by one character being off. They're caused by (say) not remembering function X will do Y under condition Z.
So, it's a proxy: you find tests that fail to catch typos as a proxy for catching tests that might miss real issues.
But how good of a proxy is it? Will finding out if a bunch of my tests miss == becoming != tell me if my tests will catch me forgetting to pass that critical foo argument to my doBar? ¯\_(ツ)_/¯
The one thing we know mutation testing is good for is catching typos, and with AI writing all my code, typos are the last thing I worry about.
It's very handy to have around when working on tests for new modules, etc.
It can probably still be useful for increasing test coverage in an interactive way, but the article doesn’t give any methodology to decide when enough is enough, or even for assessing the relative relevance of different mutations. So it’s a bit like poking around in the dark.
[0] except in the rare case that the possible inputs can be exhaustively enumerated in short finite time, such as testing a pure function taking a 32-bit integer as its sole input
On the plus side, computers are faster now, so it's possible to run quantities of regression tests that would have been unthinkable 20 years ago.
(At least that was my experience with ts/js and stryker in 2021 where i last used it)
I would say results are mixed.
They do catch real bugs, but also are generally very noisy. Expensive/long to run.
Imo I think mutation and similarly fuzz testing are best applied selectively.
Work best on self contained, complex logic. Parsers, serialises, transforms that kind of thing.
What I mean is, except for literal typos, bugs aren't generally caused by one character being off. They're caused by (say) not remembering function X will do Y under condition Z.
So, it's a proxy: you find tests that fail to catch typos as a proxy for catching tests that might miss real issues.
But how good of a proxy is it? Will finding out if a bunch of my tests miss == becoming != tell me if my tests will catch me forgetting to pass that critical foo argument to my doBar? ¯\_(ツ)_/¯
The one thing we know mutation testing is good for is catching typos, and with AI writing all my code, typos are the last thing I worry about.