Skip to content

Mutation testing ​

IDGroupTypeBackendsFigureProgram
R2RegressionCCPU (gfortran)yesscripts/mutation_test.py

Case and scope ​

A test suite is only as good as the defects it catches. The mutation run plants one defect at a time in a scratch copy of the tree, rebuilds the tests, runs the whole suite (scripts/run_tests.sh) and records which test programs fail. A mutant no test catches is a defect the suite cannot see. The mutants edit the generated Fortran, not the generator: what is measured is the tests, and the tests never run the generator.

Setup ​

Each mutant replaces the first occurrence of a text after an anchor in code (never in a comment: a mutated comment is an equivalent mutant). They cover one coefficient of each row family (one of them the smallest coefficient of the widest FD first derivative), the pair signs and offsets of the centred kernels, the division by the step, the mirror of a left-side kernel and its sign, the order of a flux difference, a dispatcher's case and its NaN, the NaN constant itself, and the wiring of the 3-D operators; for the FD face kernels of phase 2, a coefficient of each new row type, the pair sign and step of a face derivative, the mirror read of a one-sided and of a biased kernel, and a biased dispatcher's case; and for roadmap #2, a face-difference row, a dissipation part's sign and constant, an FV biased row and its mirror, a filter row and pair sign, a dissipation dispatcher's case, the line solvers' pivot, periodic column, border, factor reuse and masks, a compact operator's band, right side, pair sign, step, αf row and term and biased mirror; and for the factored solves (#2 decision 4a), a pivot of the tridiagonal factor, the pentadiagonal factor's carry of row i−2, and the periodic pentadiagonal border.

ItemChoiceCode
Copythe tracked and untracked files of the working tree and the fetched PENF, into --workdir (default a new temporary directory); the working tree is never modifiedmutation_test.py
Buildfobis build --mode tests-gnu --force-compile per mutant: FoBiS does not rebuild the dependents of a changed cpp #include, so an incremental build could keep a stale mutantfailing_tests
Baselinethe unmutated copy must be green first
Killedat least one test program fails (FAIL or XPASS in the report of run_tests.sh)
bash
python3 scripts/mutation_test.py --mode tests-gnu [--workdir DIR] [--only NAME ...]
python3 scripts/mutation_test.py > notes/mutation-run-<date>[-<label>].txt   # recorded: the tables pick it up

The tables below are those of the newest recorded run that lists exactly the current mutants (docs/scripts/make_tables.py): a run of an older mutant list documents an older suite.

Results ​

The recorded run of the current suite and its 56 mutants, notes/mutation-run-2026-11-18-factored.txt. The earlier runs stay recorded: the first release's 22 mutants (notes/mutation-run-2026-11-17.txt), the same against the suite with the spectral test (notes/mutation-run-2026-11-17-spectral.txt), phase 2's 30 (notes/mutation-run-2026-11-17-phase2.txt) and roadmap #2's 53 (notes/mutation-run-2026-11-18-p2.txt), every mutant killed in each.

56 of 56 mutants killed (mutation-run-2026-11-18-factored.txt, 2026-11-18).

MutantFileChangeKilled by (gideon_test_…)Tests
row-fd-d1-c6gideon_tables.F903._R_P/4._R_P → 0.7501_R_Padam, golden, operators_3d, order, tables5
row-fd-d1-c10-tailgideon_tables.F901._R_P/1260._R_P → 1._R_P/1261._R_Padam, golden, operators_3d, order, tables5
row-fv-face-c4gideon_tables.F907._R_P/12._R_P → 0.5834_R_Padam, golden, operators_3d, order, properties, split, tables7
row-fv-uface-3gideon_tables.F90-7._R_P/6._R_P → -1.1667_R_Padam, golden, order, properties, tables5
row-fv-point-c6gideon_tables.F903._R_P/640._R_P → 3._R_P/641._R_Padam, golden, order, properties, tables5
pair-sign-fd-d2-c4gideon_fd_centred.F90(q(m) + q(-m)) → (q(m) - q(-m))adam, golden, operators_3d, order, properties, spectral, tables7
pair-offset-fd-face-c8gideon_fd_centred.F90q(m) + q(1-m) → q(m) + q(-m)adam, golden, order, properties, split, tables6
pair-sign-fd-average-c6gideon_deconvolution.F90(q(m) + q(-m)) → (q(m) - q(-m))adam, golden, order, properties, tables5
flux-face-offset-fv-d1-c6gideon_fv_centred.F90(q(m-1) + q(-m)) → (q(m) + q(-m))adam, golden, operators_3d, order, properties, spectral, tables7
scale-fd-d3-c4gideon_fd_centred.F90d = d/ds/ds/ds → d = d/ds/dsadam, golden, order, properties4
scale-fv-d2-c4gideon_fv_centred.F90/(ds*ds) → /dsadam, golden, operators_3d, order, properties5
scale-fv-d6-ur2gideon_fv_upwind.F90/(ds*ds*ds*ds*ds*ds) → /(ds*ds*ds*ds*ds)golden, properties2
mirror-fv-face-ul3gideon_fv_upwind.F90q(1-m) → q(-m)adam, golden, order, properties, tables5
mirror-sign-fv-face-d1-ul2gideon_fv_upwind.F90d = -d/ds → d = d/dsadam, golden, order, properties, tables5
difference-order-fv-d2-ul2gideon_fv_upwind.F90d = (gl-gr) → d = (gr-gl)adam, golden, order, properties, spectral, tables6
face-offset-fv-d1-ur3gideon_fv_upwind.F90gl = gl + FV_UFACE_S3(m)*q(m-1) → gl = gl + FV_UFACE_S3(m)*q(m)adam, golden, order, properties, spectral, tables6
dispatch-wrong-kernelgideon_dispatch.F90case(4) ; call gideon_fd_d1_c4 → case(4) ; call gideon_fd_d2_c4adam, dispatch2
dispatch-no-nangideon_dispatch.F90case default ; f = GIDEON_NAN → case default ; f = 0._R_Pdispatch1
nan-constantgideon_kind_parameters.F909221120237041090560_I8P → 4607182418800017408_I8Pdispatch, operators_3d2
curl-componentgideon_operators_3d.F90c(2) = dvx_dz - dvz_dx → c(2) = dvz_dx - dvx_dzadam, operators_3d2
divergence-stepgideon_operators_3d.F90call gideon_fd_d1_c4(vy_y, dxyz(2), dy) → call gideon_fd_d1_c4(vy_y, dxyz(1), dy)adam, operators_3d2
laplacian-directiongideon_operators_3d.F90call gideon_fv_d2_c6(qz, dxyz(3), dz) → call gideon_fv_d2_c6(qy, dxyz(3), dz)adam, operators_3d2
row-fd-face-d1-c4gideon_tables.F909._R_P/8._R_P → 1.1251_R_Pgolden, order, tables3
row-fd-uface-3gideon_tables.F90-5._R_P/4._R_P → -1.2501_R_Pgolden, order, properties, tables4
row-fd-bface-5-tailgideon_tables.F90-5._R_P/128._R_P → -5._R_P/127._R_Pgolden, order, properties, split, tables5
pair-sign-fd-face-d2-c4gideon_fd_centred.F90(q(m) + q(1-m)) → (q(m) - q(1-m))golden, order, properties, tables4
scale-fd-face-d2-c4gideon_fd_centred.F90d = d/ds/ds → d = d/dsgolden, order, properties3
mirror-fd-face-ul3gideon_fd_upwind.F90q(1-m) → q(m-3)golden, order, properties, tables4
mirror-fd-face-bl5gideon_fd_upwind.F90q(1-m) → q(m-1)golden, order, properties, split, tables5
dispatch-wrong-kernel-blgideon_dispatch.F90case(5) ; call gideon_fd_face_bl5 → case(5) ; call gideon_fd_face_bl3dispatch1
row-face-diff-5gideon_tables.F905._R_P → 5.001_R_Pgolden, order, split, tables4
bdiss-sign-fd-br5gideon_dissipation.F90-FD_BDISS_S2*d → FD_BDISS_S2*dgolden, order, properties, split, tables5
bdiss-constant-fv-3gideon_tables.F901._R_P/12._R_P → 1._R_P/11._R_Pgolden, order, split, tables4
row-fv-bface-5gideon_tables.F9047._R_P/60._R_P → 0.7834_R_Pgolden, order, properties, split, tables5
mirror-fv-face-bl5gideon_fv_upwind.F90q(1-m) → q(m-1)golden, order, properties, split, tables5
row-filter-c6gideon_tables.F9015._R_P/64._R_P → 0.2344_R_Pgolden, order, properties, tables4
pair-sign-fv-filter-c4gideon_filters.F90(q(m) + q(-m)) → (q(m) - q(-m))golden, order, properties, tables4
dispatch-wrong-kernel-dissgideon_dispatch.F90case(6) ; call gideon_fd_face_diss_c6 → case(6) ; call gideon_fd_face_diss_c4dispatch1
thomas-pivotgideon_line_solvers.F90p = b - a*w(i-1) → p = b + a*w(i-1)lines, lines_golden, solvers3
tri-periodic-columngideon_line_solvers.F90z(n-1) = z(n-1) + c(n-1) → z(n-1) = z(n-1) + a(n-1)solvers1
penta-resolve-pivotgideon_line_solvers.F90bp = bp - ap*u1(i-1) → bp = bp + ap*u1(i-1)lines, lines_golden, solvers3
penta-bordergideon_line_solvers.F90x1 = (r1 - s12*x2)/s11 → x1 = (r1 + s12*x2)/s11lines, lines_golden, solvers3
masked-diagonalgideon_line_solvers.F90p = merge(1._R_P, b, mask(i)) → p = bsolvers1
masked-offdiagonalgideon_line_solvers.F90ap = ap - merge(0._R_P, e, mask(i)) → ap = ap - esolvers1
band-fd-d1-p8gideon_tables.F904._R_P/9._R_P → 0.4445_R_Plines, lines_golden2
right-fd-d2-p6gideon_tables.F9012._R_P/11._R_P → 1.0910_R_Plines, lines_golden2
pair-sign-fd-face-d1-p6gideon_compact.F90(q(m) - q(1-m)) → (q(m) + q(1-m))lines, lines_golden2
scale-fd-d2-p4gideon_compact.F90r = r/ds/ds → r = r/dslines, lines_golden2
filter-alpha-row-p6gideon_tables.F9017._R_P/32._R_P → 0.5313_R_Plines, lines_golden2
filter-alpha-term-p4gideon_compact.F90alpha*FD_FILTER_P4_ALPHA(m) → alpha*FD_FILTER_P4_ALPHA(0)lines, lines_golden2
mirror-fv-face-pbl7gideon_compact.F90q(1-m) → q(m-1)coupling, lines, lines_golden3
band-fv-face-pbl5gideon_tables.F901._R_P/2._R_P → 0.5001_R_Pcoupling, lines, lines_golden3
band-fv-face-p6gideon_tables.F901._R_P/3._R_P → 0.3334_R_Plines, lines_golden2
factor-pivot-trigideon_line_solvers.F90fac(i,1) = 1._R_P/(b - a*wp) → fac(i,1) = 1._R_P/(b + a*wp)solvers1
factor-carry-pentagideon_line_solvers.F90u1pp = u1p ; u2pp = u2p → u1pp = u1 ; u2pp = u2solvers1
factored-border-pentagideon_line_solvers.F90x1 = (r1 - fac(n-1,2)*x2)*fac(n-1,1) → x1 = (r1 + fac(n-1,2)*x2)*fac(n-1,1)solvers1

Which test kills which mutant

Every mutant (rows) and the test programs that fail on it (filled), from the recorded run.

TestMutants it killsMutants only it kills
gideon_test_golden300
gideon_test_order290
gideon_test_tables260
gideon_test_properties250
gideon_test_adam190
gideon_test_lines120
gideon_test_lines_golden120
gideon_test_operators_3d100
gideon_test_split90
gideon_test_solvers96
gideon_test_dispatch53
gideon_test_spectral40
gideon_test_coupling20

Findings ​

  • Every mutant is killed, most by four or more programs: the suite is redundant by design, each contract checked from more than one side.
  • Only gideon_test_dispatch kills dispatch-no-nan and dispatch-wrong-kernel-bl: an order without a kernel, and the biased dispatchers (which have no ADAM counterpart to compare with), are exercised nowhere else among the 1-D operators. gideon_test_golden and gideon_test_properties are the only ones that kill scale-fv-d6-ur2: the sixth-derivative upwind kernels have no ADAM counterpart (audit C), the exactness test runs at Δs=1 where a wrong power of the step is invisible, and in R8P the kernel has no plateau (A1): a kernel that does not converge is reported unresolved, not failed (the mutant's error stays near its target while the floor rises past it: one resolved step, no plateau). The mutation run uses the R8P build; the R16P order test, rebuilt with this mutant by hand, fails on it (observed order 0, design 2).
  • The mutant dispatch-wrong-kernel (a d2 kernel in a d1 dispatcher's case) is caught by the dispatch test and by the comparison with ADAM, whose run-time-order operators the test calls through the dispatchers.
  • One mutant of roadmap #2's first draft was equivalent and was replaced: dropping the guard before a solver's read of a coefficient outside the line (if (i < n-1) u2(i) = f(i)/bp) changes only factor entries that back substitution never uses, so no result can change and no test of results can kill it. The guard keeps a corner of the band from being read at all; its replacement, penta-resolve-pivot, mutates the factor's reuse for the border columns.
  • The P2 mutants are killed by the new programs. gideon_test_solvers alone kills the periodic-column and the two masked mutants: the compact operators' tests use the constant-band solvers, and the coupling test's masked band is tridiagonal with a unit diagonal, on which merge(1, b, mask) equals b and the pentadiagonal mutant is absent. Every compact mutant is killed by gideon_test_lines and its golden test, the biased ones also by the coupling test.
  • The factored solves' mutants are killed by gideon_test_solvers alone: the compact operators' tests use _const (the benchmark uses the factored solves, but it is not a test).
  • gideon_vv_advection kills no mutant on its own: it is a demonstration with frozen physical bounds, and every defect it would see is already caught by the contracts.

Released under your choice of GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT.