supercov 4.29.19 → 4.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -173,8 +173,10 @@ Each language uses its established tool's mutants, and its verdicts were
173
173
  compared with that tool's on public projects: StrykerJS for JavaScript and
174
174
  TypeScript, under Vitest, Playwright, Jest, `node:test`, Mocha, AVA,
175
175
  node-tap, `bun:test` and Vitest Browser Mode; cargo-mutants for Rust, under
176
- `cargo test` and cargo-nextest; and in preview, mutmut for Python, Gremlins
177
- for Go and mutant for Ruby. The run already knows which tests reach
176
+ `cargo test` and cargo-nextest; PIT for Java and Kotlin, under JUnit 5,
177
+ JUnit 4, Kotest, Spock and TestNG with Maven, Gradle and Ant; mutmut for
178
+ Python, under pytest and `python -m unittest`; and in preview, Gremlins for
179
+ Go and mutant for Ruby. The run already knows which tests reach
178
180
  each mutant and which never change its value, so a mutant no test reaches or
179
181
  infects is decided without running anything, and the rest run only against
180
182
  the tests that can kill them. A plain run costs nothing more. See
@@ -336,9 +338,9 @@ Supercov uses exact per-test attribution where an adapter is available. For othe
336
338
  | Cargo's standard libtest runner | Exact test, attempt, and passing-assertion identity | cargo-mutants' mutants |
337
339
  | rustdoc doctests | Exact per doctest | cargo-mutants' mutants |
338
340
  | cargo-nextest | Exact test, attempt, retry, and binary identity | cargo-mutants' mutants |
339
- | pytest and `python -m unittest` | Exact test and setup/call/teardown phase identity | Preview: mutmut's mutants |
341
+ | pytest and `python -m unittest` | Exact test and setup/call/teardown phase identity | mutmut's mutants |
340
342
  | `go test` | Exact per test | Preview: Gremlins' mutants |
341
- | JUnit 5, JUnit 4, Kotest, Spock and TestNG | Exact per test | Not yet |
343
+ | JUnit 5, JUnit 4, Kotest, Spock and TestNG | Exact per test | PIT's mutants |
342
344
  | RSpec | Exact example and before/example/after phase identity | Preview: mutant's mutants |
343
345
  | Minitest and test-unit | Exact test and setup/test/teardown identity | Preview: mutant's mutants |
344
346
  | Cucumber | Exact scenario and hook-phase identity | Preview: mutant's mutants |
package/docs/cli.md CHANGED
@@ -178,7 +178,7 @@ npx supercov runs <run-id> [query] [options]
178
178
  | `runners` | Group coverage by test runner |
179
179
  | `scope` | See what is source and what is not, by directory and reason; `--files` lists every file |
180
180
  | `assertions` | Read the share of executed statements the tests assert, and the ones they do not; `assertions assess` works it out |
181
- | `mutants [path[:line]]` | See, for each mutant the language's established tool would make (StrykerJS, cargo-mutants; in preview mutmut, Gremlins and mutant), whether a test reached it and changed its value |
181
+ | `mutants [path[:line]]` | See, for each mutant the language's established tool would make (StrykerJS, cargo-mutants, PIT, mutmut; in preview Gremlins and mutant), whether a test reached it and changed its value |
182
182
  | `source <path>` | Read matching current project source with line numbers |
183
183
  | `minimize` | Find a small test subset that preserves a coverage target |
184
184
 
@@ -308,9 +308,9 @@ npx supercov runs <run-id> mutants --diff origin/main --fail-on not-infected,not
308
308
  ```
309
309
 
310
310
  `mutants` reads weak mutation from the run: for each mutant StrykerJS 10.1.1
311
- (JavaScript, TypeScript) or cargo-mutants 27.1.0 (Rust) would make, or in
312
- preview mutmut 3.8.1 (Python), Gremlins 0.6.0 (Go) or mutant 0.17.1 (Ruby)
313
- would make (see [Mutation testing](mutation.md)), whether a test
311
+ (JavaScript, TypeScript), cargo-mutants 27.1.0 (Rust), PIT 1.17.1 (Java,
312
+ Kotlin) or mutmut 3.8.1 (Python) would make, or in preview Gremlins 0.6.0
313
+ (Go) or mutant 0.17.1 (Ruby) would make (see [Mutation testing](mutation.md)), whether a test
314
314
  ran the mutated code and whether the mutant's value would have differed there.
315
315
  Nothing runs again. A plain run does nothing for mutants and costs nothing
316
316
  more for them: a run lists its mutants from its sources the first time they are asked for (by `mutants`,
@@ -532,8 +532,10 @@ start-up run with the server restarted for them. Jest, node:test, Mocha, AVA,
532
532
  node-tap, bun:test and Vitest's Browser Mode run one test file per start of the
533
533
  command, with the mutant switched on in every process from its start (in the
534
534
  page, under Browser Mode) and only that file's candidate tests, stopping at
535
- the first failure; Jest and Mocha keep resident runners for it. Python, Go
536
- and Ruby are in preview. Rust mutants
535
+ the first failure; Jest and Mocha keep resident runners for it. Go and Ruby
536
+ are in preview. Java and Kotlin mutants run inside the build's own
537
+ test JVM (Maven, Gradle or Ant), one test at a time, each mutant in fresh
538
+ classes. Rust mutants
537
539
  run through cargo's tests, or through the JavaScript tests that load the
538
540
  crate compiled to wasm. Go mutants run each package's test binary, built once.
539
541
  Ruby mutants run in a fork of the loaded suite under RSpec, Minitest, test-unit
@@ -578,7 +580,11 @@ phpunit`). See `docs/design/strong-mutation.md`,
578
580
  - `--budget <seconds>` stops the pass once it is spent, counted from the
579
581
  command's start (with `supercov mutants`, measuring included): it ends as a
580
582
  finished pass, its verdicts saved, and says how many mutants it left for the
581
- next, and what measuring took where that was half the budget or more. The
583
+ next, and what measuring took where that was half the budget or more. A
584
+ pass still running 8 s after its budget's stop is ended with exit `0` (`2`
585
+ with `--fail-on` or `--critical`, whose gate it could not judge), not 143:
586
+ every process a mutant's test started is ended with it, those in groups or
587
+ sessions of their own too. The
582
588
  cheapest mutants run first, by their tests' recorded times.
583
589
  - `--timeout-factor <x>`: a Playwright test that runs with a mutant is
584
590
  stopped past x times its baseline + 5 s (default 1.5, StrykerJS's), and the
package/docs/mutation.md CHANGED
@@ -13,15 +13,16 @@ counts and verdicts can be compared with that tool's:
13
13
  | Language | Mutants of | Support |
14
14
  | --- | --- | --- |
15
15
  | JavaScript, TypeScript | StrykerJS 10.1.1 | Full, under nine runners |
16
- | Python | mutmut 3.8.1 | Preview |
16
+ | Python | mutmut 3.8.1 | Full, under pytest and `python -m unittest`, on Linux and macOS |
17
17
  | Rust | cargo-mutants 27.1.0 | Full, under `cargo test` (libtest and doctests) and cargo-nextest |
18
+ | Java, Kotlin | PIT 1.17.1, its default mutators | Full, under JUnit 5, JUnit 4, Kotest, Spock and TestNG, with Maven, Gradle and Ant |
18
19
  | Go | Gremlins 0.6.0, every mutator | Preview |
19
20
  | Ruby | mutant 0.17.1, light operators | Preview |
20
21
 
21
22
  A preview language works end to end and was validated against its tool on
22
23
  public projects (see [Compared with the established tools](#compared-with-the-established-tools)),
23
24
  but has been run on fewer projects than JavaScript and may change in a later
24
- release. Java and Kotlin have no mutants in this release. On Windows,
25
+ release. On Windows,
25
26
  Python's and Ruby's mutants are listed and the weak report reads them, but
26
27
  the strong pass does not run them: their drivers fork the loaded suite, which
27
28
  Windows cannot, so each is counted "not run" under its runner.
@@ -83,6 +84,19 @@ first pass of their own:
83
84
  the original is `equivalent`, and is not run; mutants whose files compile
84
85
  to the same code as each other run once, and each takes that run's verdict
85
86
  (see Equivalent mutants, below).
87
+ - a Rust mutant whose candidate tests all pass, where no test process ever
88
+ ran its mutated code, is `no-coverage` with the reason
89
+ `not-reached-mutated`, not `survived`: its tests ran something built apart
90
+ from the pass, such as a Worker's wasm that `wrangler dev` built, and could
91
+ not have failed. A switched build's processes say when they first evaluate
92
+ their mutant; a mutant built on its own, a `wasm-pack test` pass, and one
93
+ resumed from candidates an earlier pass ran are judged as before.
94
+ - a Rust Worker that a `cargo test` suite starts with `wrangler dev` runs
95
+ its mutants switched on, as the measured run serves it: built once per
96
+ pass from the `[build] command` (`worker-build`, or a script that runs
97
+ it), each test's mutant switched on in the Worker's wasm, so its verdicts
98
+ are those of a Worker built with the mutant. A mutant that does not
99
+ compile for wasm is built on its own.
86
100
 
87
101
  Each of these shortcuts is exact. Where the run cannot prove a test is
88
102
  irrelevant, the test runs.
@@ -431,15 +445,20 @@ restored, it measures nothing, as below. Name the command after `--`: without it
431
445
  Every job must measure the same commit with the same dependencies, as for any
432
446
  merge ([CLI reference](cli.md#combine-shards)).
433
447
 
434
- - **The shares.** Each job computes the same split from its own run: the
435
- mutants to run are dealt in turn, back and forth, most costly first, so
436
- every share gets its part of the costly ones. A mutant's cost there is what
437
- the plan lists of it, the copies of test files it starts and the tests they
438
- run, not the tests' times, which differ between jobs.
448
+ - **The shares.** Every job deals the same split, whatever its own
449
+ measuring found: a mutant's share follows from its id alone (a hash of
450
+ it), so each mutant is in exactly one share, decided or not, and the
451
+ shards' verdicts add up to the merge's. A split read from each job's own
452
+ measurement, as up to 4.29.19 (the costliest dealt first), differed where
453
+ the suite covers a little differently from run to run (randomized inputs,
454
+ timing): some mutants ran in two jobs and some in none.
439
455
  - **The budget.** `--budget <seconds>` ends a job in time without a
440
456
  `timeout` around it: it counts from the command's start, measuring
441
457
  included, and past it the pass stops, saves what it decided, and exits as
442
- a finished pass. Within a pass the cheapest mutants
458
+ a finished pass: `0`, or what `--fail-on` makes it. A pass that does not
459
+ end within 8 s of its budget's stop is ended, its verdicts saved, still
460
+ with `0` (`2` where it gates with `--fail-on` or `--critical`, whose
461
+ verdicts it could not judge), never a termination's 143. Within a pass the cheapest mutants
443
462
  run first, so a job cut short has decided as many as it could, and the
444
463
  mutants it left run in the next commit's pass, where the restored runs lend
445
464
  the rest of their verdicts.
@@ -460,7 +479,8 @@ merge ([CLI reference](cli.md#combine-shards)).
460
479
  again: the run holds that run's evidence
461
480
  under an id of its own. It keeps every verdict a pass reached that the
462
481
  restored runs hold (`1317 verdict(s) kept from runs r8, r7, r6, r5: the
463
- checkout is unchanged since them`), and the shares are of what is left.
482
+ checkout is unchanged since them`), and each job runs what is left of
483
+ its share.
464
484
  Mutants the plan decides without running, such as a survivor no test
465
485
  infected, are decided again, not kept. Each job's run replaces the
466
486
  restored ones of its command, so the last job's `supercov merge` takes this
@@ -471,7 +491,8 @@ merge ([CLI reference](cli.md#combine-shards)).
471
491
  the earlier rounds' verdicts, counts for the first run named.
472
492
  - **The next pass.** The restored runs lend their verdicts on a later
473
493
  commit: each job keeps every verdict nothing changed could move, from
474
- whichever earlier job's run holds it, and the shares are of what is left.
494
+ whichever earlier job's run holds it, and each job runs what is left of
495
+ its share.
475
496
  Keep the merged run's parts with it: a merged run's `tests affected` is
476
497
  answered from them.
477
498
  - **Copies of one run.** Up to 4.29.5, `supercov mutants --shard` on a
@@ -540,8 +561,9 @@ no mutants shows none of this.
540
561
  | Language | Strong pass runs under |
541
562
  | --- | --- |
542
563
  | JavaScript, TypeScript | Vitest, Vitest Browser Mode, Playwright, Jest, `node:test`, Mocha, AVA, node-tap, `bun:test` |
543
- | Python (preview) | pytest, `python -m unittest` |
564
+ | Python | pytest, `python -m unittest` |
544
565
  | Rust | `cargo test` (libtest and doctests), cargo-nextest; wasm in Node, under WASI and in Chrome |
566
+ | Java, Kotlin | JUnit 5, JUnit 4 (through Vintage and under Ant's `<junit>`), Kotest, Spock, TestNG; Maven, Gradle, Ant |
545
567
  | Go (preview) | `go test` |
546
568
  | Ruby (preview) | RSpec, Minitest, test-unit, Cucumber |
547
569
 
@@ -628,7 +650,7 @@ no mutants shows none of this.
628
650
  mutants are not planned. A function body StrykerJS empties where no switch
629
651
  can be placed is `error`.
630
652
 
631
- ### Python (preview)
653
+ ### Python
632
654
 
633
655
  The tests are collected once; each mutant then runs in a fork of that
634
656
  process, its function switched to mutmut's copy, against its candidate tests
@@ -636,7 +658,27 @@ in collection order. A mutant whose code ran while the test modules loaded (a
636
658
  decorator applied at import) runs in a fresh interpreter with the mutant on
637
659
  from its start. `SUPERCOV_STRONG_WORKERS` sets how many forks run at once.
638
660
 
639
- Limits: Windows, since the pass forks. A suite that runs unittest through its
661
+ - **Time limits**: a mutant's tests get three times their baseline and
662
+ 10 s. Tests past their limit beside other forks run again alone, after a
663
+ run of them without the mutant sets the limit, so a busier machine makes
664
+ no timeout; a loop the mutant makes endless is a `timeout` at once, past
665
+ its hit limit.
666
+ - **Stopping**: `--budget` and a signal stop the pass at once, its forks
667
+ with it, and nothing a stop cut short is judged.
668
+ - **Skipped tests** (`pytest.mark.skip`, `skipif`, `unittest.skip`) are
669
+ recorded `skipped`, never as tests that did not pass; they still run in
670
+ the pass, as mutmut runs them, since a mutant can turn a skip into a
671
+ failure.
672
+ - **Merged runs**: parts that differ only in the tests they select
673
+ (`pytest tests/a`, `pytest tests/b`; `python -m unittest tests.test_a`,
674
+ `tests.test_b`) run under one command selecting them all, and
675
+ pytest-split's `--splits` and `--group` are dropped.
676
+ - **Environments**: CPython 3.9 to 3.14, started as `python -m pytest`, the
677
+ environment's `pytest` script, `uv run` or `poetry run`, from a virtual
678
+ environment uv or pip made.
679
+
680
+ Limits: Windows, since the pass forks: there the mutants are listed and the
681
+ weak report reads them, and each is counted not run. A suite that runs unittest through its
640
682
  own script (`TextTestRunner().run`) rather than `unittest.main` has its
641
683
  mutants recorded `error`. mutmut's `do_not_mutate_patterns` and
642
684
  `mutate_only_covered_lines` are not read.
@@ -679,6 +721,51 @@ measured run skipped (`#[ignore]`, unless the command asked for
679
721
  `--ignored` or `--include-ignored`) is recorded `skipped`, not failed, and
680
722
  is never a candidate.
681
723
 
724
+ ### Java and Kotlin
725
+
726
+ The mutants are PIT's default mutators, made from source rather than bytecode
727
+ (`ConditionalsBoundary`, `NegateConditionals`, `Math`, `Increments`,
728
+ `InvertNegs`, `VoidMethodCall` and the return mutators), with PIT's default
729
+ filters applied in source terms (`docs/design/jvm-mutation.md`). `supercov
730
+ runs latest mutants --format pit` writes them as PIT's XML report, and
731
+ `supercov runs latest mutants pit <mutations.xml>` joins a PIT report with
732
+ the run's verdicts.
733
+
734
+ The build compiles one switched copy and starts its test JVM as it always
735
+ does (Maven's Surefire, Gradle's `test` task, Ant's `<junit>`,
736
+ `<junitlauncher>` or `<testng>`); the pass runs inside it, as PIT's minion
737
+ does, one test at a time by the name the measured run recorded.
738
+
739
+ - **Fresh classes for each mutant**: each mutant runs in a class loader that
740
+ loads the project's classes afresh, so a cache or a static a test filled
741
+ without the mutant does not hide it.
742
+ - **A test class's own work** (`@BeforeAll`, `@AfterAll`, a `@MethodSource`,
743
+ a static initializer, JUnit 4's `@BeforeClass`, a Kotest spec's body) is
744
+ credited to every test of its class: a mutant there runs against them.
745
+ - **Baselines**: each test runs twice without a mutant before any mutant
746
+ runs against it; one that fails then is no candidate, and a kill is
747
+ confirmed by running the killing test again without the mutant.
748
+ - **Time limits**: the longer of the test's measured time and its baseline,
749
+ × 1.5, at least 1 s; a mutant past it waits for a second round with × 3
750
+ and 10 s, past which it is a `timeout`. A mutant whose code loops past a
751
+ million evaluations is stopped there.
752
+ - **Several JVMs** (`SUPERCOV_STRONG_JVMS`, by default half the machine's
753
+ processors, at most eight) share the pass; each works in a directory of
754
+ its own made of links to the project's files, so the files one JVM's test
755
+ makes or deletes are not another's.
756
+ - **Stopping**: `--budget` stops the pass; each mutant decided is kept for
757
+ the next pass.
758
+
759
+ Limits: a Kotest test runs through Kotest's own filter
760
+ (`kotest.filter.tests`); where its baseline does not run that way, it runs
761
+ with its whole spec, which is slower. Code kotlinc writes that has no source
762
+ of its own (inlined standard-library code, property accessors, the null
763
+ checks it adds) has no mutant here, where PIT mutates it: `mutants pit` names
764
+ each such PIT-only mutant's category. Under TestNG, which reports no class
765
+ boundary, work outside every test is credited to every test of the run. On
766
+ Windows without the right to make links, the JVMs share one directory and
767
+ say so.
768
+
682
769
  ### Go (preview)
683
770
 
684
771
  Each package's test binary is built once (`go test -c`); each mutant runs the
@@ -711,7 +798,6 @@ Measured on public projects pinned to a tag, every mutant of each tool joined
711
798
  by its id. A soundness violation is a mutant one tool kills and the other
712
799
  calls survived; every disagreement was applied by hand and the suite run as
713
800
  written. Each tool's settings and every disagreement are in `docs/design/`.
714
- Support for PIT's mutants, for Java and Kotlin, is planned.
715
801
 
716
802
  ### JavaScript and TypeScript, against StrykerJS 10.1.1
717
803
 
@@ -766,7 +852,7 @@ kill by a test that fails run alone and passes in the whole suite. Where
766
852
  StrykerJS has no runner of its own (`node:test`, AVA, Bun) it runs the whole
767
853
  command per mutant, and Supercov is 2.5 to 3.5 times faster.
768
854
 
769
- ### Python (preview), against mutmut 3.8.1
855
+ ### Python, against mutmut 3.8.1
770
856
 
771
857
  Against mutmut's full kill matrix (every test against every mutant), 5,438
772
858
  mutants, on 16-CPU Linux machines (AWS c8a and m8a.4xlarge), 2026-11-22:
@@ -775,6 +861,32 @@ Supercov detects. The five Supercov detects alone each fail the suite as
775
861
  written when applied by hand: mutmut does not switch on a mutant in a module
776
862
  run with `-m`, or in a decorator applied as the test modules load.
777
863
 
864
+ markupsafe 3.0.3 (a C extension beside the pure Python code, every test run
865
+ against both) and semver 3.0.4 (heavily parametrized tests and doctests),
866
+ 1,101 mutants, against the same matrix on 4-CPU GitHub-hosted Linux runners,
867
+ 2026-11-27 and 2026-11-28: every mutant the matrix detects, Supercov detects,
868
+ with no `error`. Applied by hand, each of the four Supercov detects alone
869
+ fails the suite as written, in code that runs as the modules load, which
870
+ mutmut does not switch on. Three stop pytest before any test runs: one in
871
+ markupsafe's module `__getattr__`, which the suite's `conftest.py` reaches as
872
+ it imports, and two in semver's `deprecated` decorator. The fourth, also in
873
+ that decorator, fails 136 of semver's 350 tests.
874
+
875
+ The same two projects under other interpreters and launchers, each pass's
876
+ verdicts against those under CPython 3.12 and `python -m pytest`:
877
+
878
+ | Pass | markupsafe (336) | semver (765) |
879
+ | --- | ---: | ---: |
880
+ | CPython 3.10 | 335 same | 765 same |
881
+ | CPython 3.13 | 336 same | 765 same |
882
+ | pip's `pytest` script | 336 same | 765 same |
883
+ | `uv run` | 336 same | 765 same |
884
+ | `poetry run` | 336 same | 765 same |
885
+ | with the value probes | 336 same | 765 same |
886
+
887
+ The one difference is a mutant that passes `None` to `str.splitlines`:
888
+ 3.10's test fails with it, 3.12's passes.
889
+
778
890
  Wall time with mutmut at one child per CPU and Supercov's forks one per CPU,
779
891
  each tool on a machine of its own, 4-CPU Linux machines (AWS m8a.xlarge),
780
892
  2026-11-22, parse's pytest-cov off for both:
@@ -786,6 +898,9 @@ each tool on a machine of its own, 4-CPU Linux machines (AWS m8a.xlarge),
786
898
  | parse 1.22.4 | 1,306 | 56.5 s | 1.4 + 12.6 s |
787
899
  | humanize 4.17.0 | 1,348 | 152.3 s | 4.6 + 19.8 s |
788
900
 
901
+ On the GitHub-hosted runners above: markupsafe, mutmut 7.8 s, Supercov
902
+ 0.8 + 1.4 s; semver, mutmut 23.6 s, Supercov 2.0 + 10.3 s.
903
+
789
904
  ### Rust, against cargo-mutants 27.1.0
790
905
 
791
906
  Eleven public crates pinned to a tag (`benchmarks/mutation/rust/`), every
@@ -845,6 +960,60 @@ down twice. Each earlier gap the benchmark found is fixed and held by a test (`C
845
960
  run, operator mutants that regroup their expression, unviable mutants no
846
961
  test reaches.
847
962
 
963
+ ### Java and Kotlin, against PIT 1.17.1
964
+
965
+ Eight public projects pinned to a tag (`benchmarks/mutation-jvm/`), every
966
+ mutant joined by file, line, mutator and PIT's description (`supercov runs
967
+ latest mutants pit`): PIT as a team runs it (each mutant until its first
968
+ kill) and Supercov's measured run and strong pass, over the same source files
969
+ in shards of each project, on GitHub's `ubuntu-latest` (4 vCPUs), 4 PIT
970
+ threads and 4 JVMs for the strong pass, 2026-11-27
971
+ (`.github/workflows/mutation-jvm.yml`). Times are summed over each tool's
972
+ jobs, in seconds; each Supercov job measures the whole suite once.
973
+
974
+ | Project | Shape | PIT mutants | Supercov mutants | Joined | Agree | Soundness violations | PIT | Supercov measured + strong |
975
+ | --- | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
976
+ | commons-cli 1.9.0 | Java, JUnit 5, Maven | 882 | 882 | 881 | 879 | 1 | 98 | 29 + 186 |
977
+ | commons-csv 1.12.0 | Java, JUnit 5, Maven | 720 | 719 | 717 | 717 | 0 | 147 | 56 + 194 |
978
+ | typetools 0.6.3 | Java, TestNG, Maven | 216 | 216 | 216 | 213 | 3 | 28 | 14 + 49 |
979
+ | java-diff-utils 4.12 | Java, JUnit 5, Maven, multi-module | 652 | 660 | 645 | 645 | 0 | 166 | 482 + 595 |
980
+ | Apache Ant 1.10.15 `util` | Java, JUnit 4 under Ant's `<junit>` | 2,083 | 2,056 | 2,039 | 2,031 | 8 | 258 | 63 + 245 |
981
+ | picnic 0.5.0 | Kotlin, JUnit 4, Gradle | 632 | 342 | 318 | 317 | 1 | 56 | 39 + 87 |
982
+ | kotlinpoet 1.14.2 | Kotlin, JUnit 4, Gradle, 12 shards | 2,114 | 1,213 | 1,121 | 1,117 | 4 | 1,394 | 968 + 2,235 |
983
+ | aedile 3.0.4 | Kotlin, Kotest, Gradle | — | 28 | — | — | — | — | 117 + 324 |
984
+
985
+ PIT does not run Kotest, so aedile has no join: all 28 of its mutants are
986
+ killed. Every soundness violation was checked, the mutant applied to the
987
+ source and the project's own suite run with it:
988
+
989
+ - **Supercov killed, PIT survived or no coverage (14):** code that runs only
990
+ as a class's statics are set up (typetools' `TypeResolver` initializer,
991
+ 3; picnic's `textBorder.kt:5`; Ant's cached parser factories and package
992
+ list, `JAXPUtils` and `JavaEnvUtils`, 5; Ant's `SymbolicLinkUtils.java:55`,
993
+ read into a test class's static field): PIT switches a mutant into a JVM
994
+ whose statics are already set, so the mutant never runs there, where
995
+ Supercov loads the project's classes afresh for each mutant. kotlinpoet's
996
+ `CodeWriter.kt:41` and `Taggable.kt:73` are in `inline` functions, whose
997
+ code runs only copied into callers compiled before PIT mutates anything;
998
+ `Taggable.kt:28` and `:63` are reached only by a JUnit 4 parameterized
999
+ test whose names carry identity hashes, which PIT cannot select again.
1000
+ - **Supercov survived, PIT killed or timed out (3):** with the mutant applied,
1001
+ the project's whole suite passes: commons-cli's `OptionBuilder.java:141`
1002
+ and Ant's `FileUtils.java:1204` are killed in PIT's single JVM by state an
1003
+ earlier test left; Ant's `VectorSet.java:228` makes `retainAll` slower
1004
+ (its speed test passes in 5.7 s alone), a timeout in PIT's loaded JVMs and
1005
+ within Supercov's second-round limit.
1006
+
1007
+ Mutants one tool lists and the other does not: on the Java projects, a few
1008
+ (PIT's loop filters match some loops of a source shape and not others; a
1009
+ lambda whose return type the source does not show). On Kotlin, PIT mutates
1010
+ code kotlinc writes that has no source of its own (property accessors, null
1011
+ checks it adds, inlined standard-library code, `when` subject comparisons):
1012
+ `mutants pit` names each such mutant's category, and leaves 52 of
1013
+ kotlinpoet's and 11 of picnic's as `other`. Supercov's own extra Kotlin
1014
+ mutants include operators on a type the source does not show that the
1015
+ compiler refuses (`unviable`). Details in `docs/design/jvm-mutation.md`.
1016
+
848
1017
  ### Go (preview), against Gremlins 0.6.0
849
1018
 
850
1019
  Five modules at their tags, Gremlins with every test per mutant
@@ -103,11 +103,75 @@ Most of what the tests add is waiting, not Supercov's own code:
103
103
  more with each one. On the suite above, the same test cost about 120 ms more
104
104
  late in a whole run than at the start of a run of an eighth of it.
105
105
 
106
+ On a generated app with heavy pages and a new context per test
107
+ (`benchmarks/large-app`, sixteenths of its 300 tests), the measured run uses
108
+ about 22% more CPU than plain. Most of that is there with almost nothing
109
+ instrumented (one file measured: +12%): the collector's calls, the runtime's
110
+ preload in every Node process, and the build, each a little:
111
+
112
+ | Process, CPU s per sixteenth | Plain | Measured | One file measured |
113
+ | --- | --- | --- | --- |
114
+ | `next build` | 23.1 | 26.5 | 24.1 |
115
+ | `next start` | 5.5 | 6.6 | 6.5 |
116
+ | Playwright's runner and worker | 5.3 | 6.9 | 6.9 |
117
+ | Chrome's pages | 4.5 | 5.9 | 6.0 |
118
+ | Chrome's browser and network processes | 4.0 | 4.8 | 4.7 |
119
+
120
+ Switching parts off one at a time moves the total by about a point each:
121
+ telling pages each phase (2), the phase cookies (1.3), recording in pages
122
+ (0.9), and the runtime's prelude in each document, whether or not minified
123
+ (0.6). The source maps of instrumented files, Node's `--enable-source-maps`,
124
+ its compile cache and the async hook that keeps a probe's context cost nothing
125
+ measurable. Reading what each loaded module exports, for container SDKs, takes
126
+ about 0.1 s of CPU in such a part, and about 4.5 s over a large Vitest suite's
127
+ 151 processes.
128
+
129
+ #### Why each action still waits for the page
130
+
131
+ Telling a page a new phase is one round trip that the action waits for:
132
+ about 4 to 6 ms, almost all of it the page taking up the message while it
133
+ renders, so sending it through Chrome's protocol directly is no faster. Not
134
+ waiting was considered and declined. An action that checks its element first
135
+ (a click or a fill without `force`) sends those checks on the same protocol
136
+ session as the phase, and Chrome runs a session's messages in order, so it
137
+ would be enough to wait until the phase was sent rather than answered.
138
+ Keyboard and mouse calls, navigation, `force` and the phase cookies have no
139
+ such ordering and would still wait. Knowing when Playwright has sent a message
140
+ means hooking its internals, which change between versions, and an ordering
141
+ assumption that is wrong once credits a page's work to the wrong step. That
142
+ would lose accuracy for about 3% of a browser suite's test time, so every
143
+ action still waits.
144
+
106
145
  The server records every test's first hits in each phase as lines of JSON. It
107
146
  writes them through a file kept open, and builds each line directly, which
108
147
  takes about a third of the time it did before. The collector reads each page's
109
148
  evidence in the columns it stores, which takes about a quarter of the time.
110
149
 
150
+ ### Where a unit suite's time goes
151
+
152
+ Excalidraw's Vitest suite (7,052 test records, jsdom, on a 4-CPU runner)
153
+ retires about 25% more instructions measured than plain, and takes 190 to
154
+ 205 s against 150 to 160 s. Almost none of that is the instrumented code
155
+ running: with every probe still called but recording nothing, the suite
156
+ retires 2% more than plain. It is the evidence:
157
+
158
+ - **In the test workers**, each statement's first hit in each phase of a
159
+ test (each assertion is a phase), each decision vector and each selection
160
+ is recorded, and the test's record is written when it ends: 779 MB of
161
+ JSON for the suite, mostly hit ids (190 MB), decisions (138 MB), assertion
162
+ phases (87 MB) and the events that say which phase first hit each point.
163
+ - **After the tests**, Supercov reads those records (1.4 s), names each
164
+ probe by its point (1.9 s), builds the views (6 s) and publishes the run
165
+ (3.8 s): about 13 s on the run's critical path, beside its compression.
166
+
167
+ Writing the records smaller does not make it faster: numbered ids and
168
+ vectors as text cut the evidence by 46% and the run retired 2.4% more
169
+ instructions, because each item costs about the same whichever way it is
170
+ written. What a unit suite pays is per item recorded, not per byte.
171
+
172
+ `scripts/speed/evidence-composition.mjs` says what a run's evidence is made
173
+ of, field by field.
174
+
111
175
  ### Prove a speed-up changes nothing
112
176
 
113
177
  A change meant to make measurement faster must leave every answer as it was.
@@ -189,6 +253,10 @@ artifact can leave it out:
189
253
  tar czf supercov-runs.tgz --exclude 'query-index.v1.bin' .supercov/runs
190
254
  ```
191
255
 
256
+ A run also keeps the view its reports read (`run-view.json.gz`, a few
257
+ megabytes), so an export or the HTML report does not analyse the evidence
258
+ again. Like the index, it is a cache, made again when it is missing.
259
+
192
260
  A merged run holds a copy of each run's evidence and an index of its own, so
193
261
  merging adds about as much again. To hand a run to a reviewer, the HTML report
194
262
  (`npx supercov report`) is usually the smaller artifact.
@@ -21,11 +21,11 @@ npx supercov -- mvn test
21
21
  | JavaScript | Available | `npx supercov -- npm test` | StrykerJS 10.1.1's mutants |
22
22
  | TypeScript | Available | `npx supercov -- npm test` | StrykerJS 10.1.1's mutants |
23
23
  | Rust | Available | `npx supercov -- cargo test` | cargo-mutants 27.1.0's mutants |
24
- | Python | Available | `npx supercov -- pytest` | Preview: mutmut 3.8.1's mutants |
24
+ | Python | Available | `npx supercov -- pytest` | mutmut 3.8.1's mutants (Linux and macOS) |
25
25
  | Ruby | Available | `npx supercov -- rspec` | Preview: mutant 0.17.1's mutants |
26
26
  | Go | Available | `npx supercov -- go test ./...` | Preview: Gremlins 0.6.0's mutants |
27
- | Java | Available | `npx supercov -- mvn test` | Not yet |
28
- | Kotlin | Available | `npx supercov -- ./gradlew test` | Not yet |
27
+ | Java | Available | `npx supercov -- mvn test` | PIT 1.17.1's mutants |
28
+ | Kotlin | Available | `npx supercov -- ./gradlew test` | PIT 1.17.1's mutants |
29
29
  | Zig | Coming soon | — | — |
30
30
  | PHP | Coming soon | — | — |
31
31
  | C | Coming soon | — | — |
@@ -37,9 +37,10 @@ The npm-distributed CLI requires Node.js 22 or newer for every language.
37
37
  `npx supercov mutants -- <test command>` lists the mutants the language's
38
38
  established tool would make of every source the run measured, says from the
39
39
  run which ones no test reaches or infects, and runs the rest against the tests
40
- that reach them. JavaScript, TypeScript and Rust are fully supported; Python,
41
- Go and Ruby are in preview, each validated against its tool on public
42
- projects; Java and Kotlin have no mutants yet. The Mutation testing column of
40
+ that reach them. JavaScript, TypeScript, Rust, Java, Kotlin and Python are
41
+ fully supported (Python's strong pass on Linux and macOS); Go and Ruby are
42
+ in preview, each validated against its tool on public projects. The
43
+ Mutation testing column of
43
44
  each runner table below says whether that runner's tests run against mutants.
44
45
  A runner without a strong driver still gets the mutants list and the weak
45
46
  report, from its coverage; its mutants are `error` in a strong pass, counted
@@ -459,10 +460,10 @@ npx supercov -- wasm-pack test --headless --chrome
459
460
 
460
461
  | Runner | Attribution | Current requirement | Mutation testing |
461
462
  | --- | --- | --- | --- |
462
- | pytest | Exact test, worker, retry, and setup/call/teardown phase identity | CPython 3.9 or newer; run with `npx supercov -- pytest` or `python -m pytest` | Preview, on Linux and macOS |
463
- | pytest-xdist | Exact per worker | Workers inherit the run through the environment | Preview: the pass turns xdist off and forks its own workers |
463
+ | pytest | Exact test, worker, retry, and setup/call/teardown phase identity | CPython 3.9 or newer; run with `npx supercov -- pytest` or `python -m pytest` | Yes, on Linux and macOS |
464
+ | pytest-xdist | Exact per worker | Workers inherit the run through the environment | Yes: the pass turns xdist off and forks its own workers |
464
465
  | pytest-rerunfailures | Exact per attempt; flaky tests are reported as such | | Preview, not verified |
465
- | `python -m unittest` | Exact test and setUp/test/tearDown phase identity | Serial in-process; skips and expected failures are recorded; subtest failures roll up to the parent test | Preview, on Linux and macOS; not a suite that runs unittest through its own script |
466
+ | `python -m unittest` | Exact test and setUp/test/tearDown phase identity | Serial in-process; skips and expected failures are recorded; subtest failures roll up to the parent test | Yes, on Linux and macOS; not a suite that runs unittest through its own script |
466
467
 
467
468
  Your project runs in place with its own interpreter and virtual environment.
468
469
  Supercov adds its runner hooks through the process environment and places a
@@ -821,15 +822,15 @@ npx supercov -- npx playwright test
821
822
 
822
823
  | Runner | Attribution | Current requirement | Mutation testing |
823
824
  | --- | --- | --- | --- |
824
- | JUnit 5 (Jupiter) | Exact per test | JDK 17 or newer, Maven or Gradle | Not yet |
825
- | JUnit 4 (through Vintage) | Exact per test | — | Not yet |
826
- | Kotest | Exact per test, under the names Kotest itself reports | — | Not yet |
827
- | Spock | Exact per feature, under the names Spock itself reports | — | Not yet |
828
- | TestNG | Exact per test, each data-provider invocation its own | — | Not yet |
829
- | JUnit 4 alone | Exact per test, through Vintage — see below | Maven or Gradle | Not yet |
830
- | JUnit 4 under Ant's `<junit>` | Exact per test, under the names Ant's XML report uses | Ant 1.10 — see below | Not yet |
831
- | Any platform engine under Ant's `<junitlauncher>` | Exact per test, through the platform listener | Ant 1.10 — see below | Not yet |
832
- | TestNG under Ant's `<testng>` | Exact per test, through the TestNG listener | TestNG 6.x with its Ant task — see below | Not yet |
825
+ | JUnit 5 (Jupiter) | Exact per test | JDK 17 or newer, Maven or Gradle | PIT's mutants |
826
+ | JUnit 4 (through Vintage) | Exact per test | — | PIT's mutants |
827
+ | Kotest | Exact per test, under the names Kotest itself reports | — | PIT's mutants, each test through Kotest's own filter |
828
+ | Spock | Exact per feature, under the names Spock itself reports | — | PIT's mutants |
829
+ | TestNG | Exact per test, each data-provider invocation its own | — | PIT's mutants |
830
+ | JUnit 4 alone | Exact per test, through Vintage — see below | Maven or Gradle | PIT's mutants |
831
+ | JUnit 4 under Ant's `<junit>` | Exact per test, under the names Ant's XML report uses | Ant 1.10 — see below | PIT's mutants |
832
+ | Any platform engine under Ant's `<junitlauncher>` | Exact per test, through the platform listener | Ant 1.10 — see below | PIT's mutants |
833
+ | TestNG under Ant's `<testng>` | Exact per test, through the TestNG listener | TestNG 6.x with its Ant task — see below | PIT's mutants |
833
834
 
834
835
  Multi-module builds are measured module by module: each compiles its own source
835
836
  set and forks its own JVM, so each gets a runtime and records evidence of its
@@ -881,6 +882,13 @@ same goes for a loop over a constant, `while (true)`, which can only go one
881
882
  way. A Kotlin `contract { }` has to stay the first statement of its function,
882
883
  so the probe that records the function being entered is written after it.
883
884
 
885
+ Mutation testing (`npx supercov mutants -- mvn test`) lists PIT's mutants of
886
+ the Java and Kotlin the run measured and runs them in the build's own test
887
+ JVM, under JUnit 5, JUnit 4 (through Vintage), Kotest and Spock on the JUnit
888
+ Platform, and TestNG, with Maven and Gradle; an Ant build's `<junit>`,
889
+ `<junitlauncher>` and `<testng>` tasks run them the same way. See
890
+ `docs/design/jvm-mutation.md`.
891
+
884
892
  Every one of these is named in the run: ask for `npx supercov runs latest
885
893
  limitations` and each appears with its file, its line, and why it was left
886
894
  alone. A source file the parser cannot read is declared there too, so a hole in
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supercov",
3
- "version": "4.29.19",
3
+ "version": "4.30.0",
4
4
  "description": "Coverage, security and code quality for coding agents",
5
5
  "keywords": [
6
6
  "coverage",
@@ -126,14 +126,14 @@
126
126
  "test:windows-tls": "node scripts/windows-tls-test.mjs"
127
127
  },
128
128
  "optionalDependencies": {
129
- "@supercov/cli-darwin-arm64": "4.29.19",
130
- "@supercov/cli-darwin-x64": "4.29.19",
131
- "@supercov/cli-linux-arm64-gnu": "4.29.19",
132
- "@supercov/cli-linux-arm64-musl": "4.29.19",
133
- "@supercov/cli-linux-x64-gnu": "4.29.19",
134
- "@supercov/cli-linux-x64-musl": "4.29.19",
135
- "@supercov/cli-win32-arm64": "4.29.19",
136
- "@supercov/cli-win32-x64": "4.29.19"
129
+ "@supercov/cli-darwin-arm64": "4.30.0",
130
+ "@supercov/cli-darwin-x64": "4.30.0",
131
+ "@supercov/cli-linux-arm64-gnu": "4.30.0",
132
+ "@supercov/cli-linux-arm64-musl": "4.30.0",
133
+ "@supercov/cli-linux-x64-gnu": "4.30.0",
134
+ "@supercov/cli-linux-x64-musl": "4.30.0",
135
+ "@supercov/cli-win32-arm64": "4.30.0",
136
+ "@supercov/cli-win32-x64": "4.30.0"
137
137
  },
138
138
  "peerDependencies": {
139
139
  "@playwright/test": ">=1.55.0",