Mutation Testing With StrykerJS and AI Agents: Matt Pocock's Loop
By Matt Cullerton, founder of Mavric and Apso
Mutation testing changes small pieces of your code, such as replacing a string with an empty one, and checks whether any test fails. In a TikTok from @mattpocockuk, Matt Pocock shows a StrykerJS report and describes handing the surviving mutants to an AI coding agent so it writes stronger tests. The approach is sound, but the caption misspells the tool as "striker.js," and Stryker's own docs say not every surviving mutant can be killed.
What is StrykerJS?
StrykerJS is the JavaScript and TypeScript version of Stryker Mutator, whose tagline is "Test your tests with mutation testing." Stryker also ships Stryker.NET for C# and Stryker4s for Scala, is sponsored by Info Support, and is licensed Apache 2.0. The StrykerJS docs say it "supports most JavaScript projects, including TypeScript, React, Angular, VueJS, Svelte, and NodeJS," with runners for Jest, Vitest, Mocha, Karma, Jasmine, Cucumber and Tap.
The repository, stryker-mutator/stryker-js, was created 2016-02-12 and had 3,245 stars on 2026-10-19. The latest release is v10.0.0, published 2026-08-14.
How is a Stryker mutation score calculated?
Stryker's docs define the states on the report:
- Killed: "When at least one test failed while this mutant was active."
- Survived: "When all tests passed while this mutant was active."
- No coverage: "The mutant isn't covered by one of your tests and survived as a result."
Mutation score is detected mutants (killed plus timeouts) divided by valid mutants (detected plus undetected), times 100.
The file in the video shows 35 killed, 31 survived and 4 with no coverage. That is 35 out of 70, a 50 percent mutation score, assuming no timeouts or errors for that file. Counting only covered code, it is 35 out of 66, or 53.0 percent. The video does not state either number, and it shows only one file.
What does a surviving mutant look like?
Pocock's example is "modify this JavaScript string to just be an empty string." The report shows "javascript" replaced by "" in a constant array of 13 language names. That is Stryker's StringLiteral mutator, which turns a filled string into "" and an empty string into "Stryker was here!".
The report labels it a "Static mutant," which Stryker defines as "a mutant that is executed once on startup instead of when the tests are running." A module-level const array is built when the file loads, so it qualifies. Static mutants need "a fresh test environment," which Stryker warns is much slower. You can skip them with --ignoreStatic, and ignored ones do not count toward your score.
For TypeScript, the @stryker-mutator/typescript-checker plugin type-checks each mutant and marks failures as CompileError, "so you won't have to waste time on mutants which result in a type error." Swapping one string for another usually still type-checks, so this mutant reaches the tests.
Do you need to kill every surviving mutant?
No. Pocock says a surviving mutant "is a mutant that needs to be killed" and that afterward "you know that every one of those tests is actually catching a potential bug in your system." Stryker's equivalent mutants page disagrees. Some mutants behave exactly like the original code, and "There is no definitive way for Stryker to find and ignore them." It suggests finding them by hand, rewriting the code, or "Accept that you won't make 100%."
PIT's documentation gives the classic case: if (i >= 1) versus if (i > 1) when i can only be 2.
So some of the 31 survivors may be impossible to kill, and an agent told to kill all of them cannot tell those apart from real test gaps. Review the survivor list before handing it over, and set a target below 100.
How to use mutation testing with AI agents
Pocock first raised the idea on X on 2026-08-02: "Anyone using agents/tools to do mutation testing? Seems like it would ROCK during automated review for flushing out which branches of the code are actually covered by tests." The TikTok is his follow-up after trying it.
A write-up dated the same day, "Mutation Testing for Agent-Written Code" by Sławomir Radzymiński, reports his own run with PITest on three Java services and StrykerJS with Vitest on a React frontend. By his numbers, the frontend went from a 60.26 percent to an 82.41 percent mutation score, and the Java backend from 81 to 89 percent. One parser had 100 percent line coverage and a 61.29 percent mutation score before the loop, which shows how code can run under tests without any assertion checking it. These are one person's results on one codebase.
A workable loop based on the video and Stryker's docs:
- Run StrykerJS and filter the report to survived and no-coverage mutants.
- Remove mutants you judge equivalent, or skip static ones with
--ignoreStaticif they are slow. - Give the remaining list to your agent and ask for tests that fail under each mutant.
- Rerun Stryker and track the score over time.
Mutation testing tools for other languages
Pocock closes with "there are plenty of options out there depending on what language you're working in." On 2026-10-19:
- Java: PIT (hcoles/pitest), Apache-2.0, 1,877 stars.
- Python: mutmut, BSD-3-Clause, 1,492 stars.
- Rust: cargo-mutants, MIT, 1,343 stars.
- C#: Stryker.NET, Apache-2.0, 2,106 stars.
- Scala: Stryker4s, Apache-2.0, 217 stars.
All five had commits in the week before that date.
Bottom line
StrykerJS is a mature, actively maintained mutation testing tool for TypeScript, and the file in the video scores 50 percent. Feeding survivors to an agent is a reasonable way to strengthen tests, but review the list first, because Stryker cannot detect equivalent mutants and recommends accepting less than 100 percent.
Sources
- Stryker Mutator: project overview and license.
- StrykerJS introduction: supported frameworks and runners.
- Mutant states and metrics: state definitions and score formula.
- Supported mutators: the StringLiteral mutator.
- Static mutants: definition and
--ignoreStatic. - Equivalent mutants: why 100% may be impossible.
- TypeScript checker: type-checking mutants.
- stryker-mutator/stryker-js: repository and releases.
- Matt Pocock on X: the original agent question.
- Mutation Testing for Agent-Written Code: Radzymiński's results.
- Total TypeScript and ai.engineer speaker page: Pocock's background.
- ai-hero-dev/ai-hero: the AI Hero project.
- pitest.org and PIT basic concepts: PIT and the equivalent mutant example.
- mutmut docs and mutants.rs: Python and Rust tools.
- GitHub repos for pitest, mutmut, cargo-mutants, stryker-net and stryker4s: star counts and activity.
Published October 14, 2026. Based on a TikTok by @mattpocockuk. Full video notes (markdown)