Repository navigation
Mutation testing of the proven ports, with a validated fast mode (#4047) - #4057
Merged
Merged
Conversation
tests/tools/mutation.py breaks a proven port one small change at a time (ROR, COR, NEG, AOR, BDM, CON, LIT, RET, DEL), drops the mutants javac refuses against the baseline's classpath, and proves the rest with the equivalence harness, N at a time under a time limit. A survivor is an equivalent mutant or a place the case never looks. It writes mutation.json / mutation.md: the score, the runs that killed each mutant (the fault runs' share), and every survivor. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
A mutant differs from the proven port in one file, yet each proof redid the COBOL runs and regenerated the whole estate. equivalence.py run --reuse EARLIER takes EARLIER's COBOL outputs for each step whose run.sh is byte-identical, and EARLIER's generated project re-overlaid with the port (the same files, or it refuses), compiling only the port's files with the pom's javac options. --first-difference stops a batch proof at the first differing run: the same verdict, fewer runs named. mutation.py uses both by default; --full keeps the from-scratch proof as the reference, and `compare` checks the two agree mutant by mutant. TRNRPT under load: a killed mutant 12-17 s instead of 282 s; a survivor still needs every run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
…current With --reuse, EquivalenceRunTest runs through the JUnit Platform launcher surefire itself drives (the same platform version, from the local repository), one fresh JVM per run, without Maven -- only when the main classes were compiled from the port and target/test-classes from this very test source (a snapshot each successful Maven run leaves); anything else goes back to Maven. The launcher class is compiled once and shared. TRNRPT smoke sample, same mutants, same verdicts: a survivor (all 25 runs) 270 s -> ~190 s under load; the date check's single-run proof ~50 s -> ~8-12 s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
mutation.py run --only DIR re-judges exactly the mutants another run judged, so the fast mode is checked against a --full reference mutant by mutant. Result: 386 of 386 agree (CSUTLDTC 206, COMEN01C 150, and 10 each of TRNRPT / POSTTRAN / INTCALC with their fault runs). docs/language_status/mutation_testing.md: operators, fast mode and its validation, first scores, and what survives (case gaps, harness gaps #4053 / #4056, equivalent mutants). The porting-loop skill points to it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
Contributor
…CodeQL) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
squid-protocol
added a commit
that referenced
this pull request
Oct 1, 2026
… (#4061) * Mutation testing of the proven ports: does "proven" mean anything? tests/tools/mutation.py breaks a proven port one small change at a time (ROR, COR, NEG, AOR, BDM, CON, LIT, RET, DEL), drops the mutants javac refuses against the baseline's classpath, and proves the rest with the equivalence harness, N at a time under a time limit. A survivor is an equivalent mutant or a place the case never looks. It writes mutation.json / mutation.md: the score, the runs that killed each mutant (the fault runs' share), and every survivor. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * Mutation testing, fast mode: --reuse and --first-difference A mutant differs from the proven port in one file, yet each proof redid the COBOL runs and regenerated the whole estate. equivalence.py run --reuse EARLIER takes EARLIER's COBOL outputs for each step whose run.sh is byte-identical, and EARLIER's generated project re-overlaid with the port (the same files, or it refuses), compiling only the port's files with the pom's javac options. --first-difference stops a batch proof at the first differing run: the same verdict, fewer runs named. mutation.py uses both by default; --full keeps the from-scratch proof as the reference, and `compare` checks the two agree mutant by mutant. TRNRPT under load: a killed mutant 12-17 s instead of 282 s; a survivor still needs every run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * Fast mode: run the equivalence test in a plain JVM when the build is current With --reuse, EquivalenceRunTest runs through the JUnit Platform launcher surefire itself drives (the same platform version, from the local repository), one fresh JVM per run, without Maven -- only when the main classes were compiled from the port and target/test-classes from this very test source (a snapshot each successful Maven run leaves); anything else goes back to Maven. The launcher class is compiled once and shared. TRNRPT smoke sample, same mutants, same verdicts: a survivor (all 25 runs) 270 s -> ~190 s under load; the date check's single-run proof ~50 s -> ~8-12 s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * Mutation testing: --only, the fast-vs-full validation, the write-up mutation.py run --only DIR re-judges exactly the mutants another run judged, so the fast mode is checked against a --full reference mutant by mutant. Result: 386 of 386 agree (CSUTLDTC 206, COMEN01C 150, and 10 each of TRNRPT / POSTTRAN / INTCALC with their fault runs). docs/language_status/mutation_testing.md: operators, fast mode and its validation, first scores, and what survives (case gaps, harness gaps #4053 / #4056, equivalent mutants). The porting-loop skill points to it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4057: explicit string concatenation in mutation.md's list literals (CodeQL) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4056: compare DISPLAY / SYSOUT in batch proofs, as IBM COBOL writes it The batch proof compared datasets, the return code and the abend, never the job log: a port that DISPLAYed the wrong message, or none, was still proven (mutation testing, #4047). - COBOL side: the step's stdout is SYSOUT. GnuCOBOL and IBM write a signed zoned item (012- vs 01K) and a binary / packed item (-00007 vs 000P) differently, so tests/equivalence/faults/ggdisplay.c (preloaded in front of cob_display) writes those as IBM documents; anything it does not model (floating point) is marked GGDISPLAY-NOT-MODELLED and that run's SYSOUT is reported as not compared, never compared against GnuCOBOL's text. - Java side: a generated batch runtime class Sysout (display, displayNoAdvancing, number: IBM's text of a numeric item). The harness points it at a per-run file. - compare_run compares SYSOUT line by line, trailing blanks aside (a SYSOUT record is blank-padded) and libcob's own messages left out, in every run -- after an abend too. The loop's feedback shows the differing lines. - The port ticket: a DISPLAY is Sysout.display with IBM's exact text (was: "a DISPLAY becomes a log line"); Sysout.java is in the prompt's runtime. - The hand ports: CBACT04C (152 lines; it never DISPLAYed each TCATBAL record, and printed a 9x status wrongly) and CBTRN02C (54 lines) route every DISPLAY through Sysout. CBTRN02C's comparison found a defect of the original: closing DALYREJS reports XREFFILE-STATUS. Kept, documented. Both proven on every run again (20 and 29 runs). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4053: compare a SEND MAP's attributes, colour, highlight, cursor and options The CICS equivalence proof compared each screen's text only: a port that showed an error in the wrong colour, or never put the cursor in the field, was still proven (mutation testing, #4047: deleting the menu's `errmsgColor = DFHRED` survived). - COBOL side: from the symbolic map's bytes, per field, the attribute byte (<f>A / <f>F: one byte), extended colour (<f>C) and highlight (<f>H) and length -1 (<f>L: the cursor), plus the SEND MAP options and CURSOR value the stub logs. The harness's DFHBMSCA holds the EBCDIC bytes, so a byte is its value. X'00' is "not set" (BMS takes the map's own); so is a space: WORKING-STORAGE GnuCOBOL initialised where IBM leaves it undefined (a map the program never cleared) -- nothing is claimed about those bytes. - Java side: CicsTask already records MapSubfields, options and cursor (#4001); compare_events now compares them, in the same terms. - The account view hand port (COACTVWC) never set them: it now ports 1300-SETUP-SCREEN-ATTRS (DFHBMFSE, the cursor, red on a bad or missing filter, the info line's colour) and SEND MAP CURSOR ERASE FREEKB. Proven again on all 11 scenarios; the menu (COMEN01C, the loop's port) was already right and stays proven. The CICS crucible compares subfields in its own pipeline since #4001. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4056 / #4053: tests -- SYSOUT comparison, subfield comparison, the DISPLAY model against IBM's text Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4056: TRNRPT's port, re-run through the porting loop on the DISPLAY rule The committed CBTRN03C port (the loop's, 2026-09-30) logged its DISPLAYs, as the ticket then said: not proven once SYSOUT is compared. A model's port is never hand-edited, so the loop ran again from scratch on the new ticket: claude-sonnet-5-5, proven on attempt 2 (447/447 report records, 264/264 SYSOUT lines, 24/24 fault runs). Attempt 1 read the records as IBM037 instead of the data's ISO-8859-1 -- the ticket never states the records' code page -- and the SYSOUT feedback showed it. Unedited; the provenance records both attempts and what it supersedes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
squid-protocol
added a commit
that referenced
this pull request
Oct 1, 2026
…ks (#4062) (#4063) * Mutation testing of the proven ports: does "proven" mean anything? tests/tools/mutation.py breaks a proven port one small change at a time (ROR, COR, NEG, AOR, BDM, CON, LIT, RET, DEL), drops the mutants javac refuses against the baseline's classpath, and proves the rest with the equivalence harness, N at a time under a time limit. A survivor is an equivalent mutant or a place the case never looks. It writes mutation.json / mutation.md: the score, the runs that killed each mutant (the fault runs' share), and every survivor. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * Mutation testing, fast mode: --reuse and --first-difference A mutant differs from the proven port in one file, yet each proof redid the COBOL runs and regenerated the whole estate. equivalence.py run --reuse EARLIER takes EARLIER's COBOL outputs for each step whose run.sh is byte-identical, and EARLIER's generated project re-overlaid with the port (the same files, or it refuses), compiling only the port's files with the pom's javac options. --first-difference stops a batch proof at the first differing run: the same verdict, fewer runs named. mutation.py uses both by default; --full keeps the from-scratch proof as the reference, and `compare` checks the two agree mutant by mutant. TRNRPT under load: a killed mutant 12-17 s instead of 282 s; a survivor still needs every run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * Fast mode: run the equivalence test in a plain JVM when the build is current With --reuse, EquivalenceRunTest runs through the JUnit Platform launcher surefire itself drives (the same platform version, from the local repository), one fresh JVM per run, without Maven -- only when the main classes were compiled from the port and target/test-classes from this very test source (a snapshot each successful Maven run leaves); anything else goes back to Maven. The launcher class is compiled once and shared. TRNRPT smoke sample, same mutants, same verdicts: a survivor (all 25 runs) 270 s -> ~190 s under load; the date check's single-run proof ~50 s -> ~8-12 s. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * Mutation testing: --only, the fast-vs-full validation, the write-up mutation.py run --only DIR re-judges exactly the mutants another run judged, so the fast mode is checked against a --full reference mutant by mutant. Result: 386 of 386 agree (CSUTLDTC 206, COMEN01C 150, and 10 each of TRNRPT / POSTTRAN / INTCALC with their fault runs). docs/language_status/mutation_testing.md: operators, fast mode and its validation, first scores, and what survives (case gaps, harness gaps #4053 / #4056, equivalent mutants). The porting-loop skill points to it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4057: explicit string concatenation in mutation.md's list literals (CodeQL) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4056: compare DISPLAY / SYSOUT in batch proofs, as IBM COBOL writes it The batch proof compared datasets, the return code and the abend, never the job log: a port that DISPLAYed the wrong message, or none, was still proven (mutation testing, #4047). - COBOL side: the step's stdout is SYSOUT. GnuCOBOL and IBM write a signed zoned item (012- vs 01K) and a binary / packed item (-00007 vs 000P) differently, so tests/equivalence/faults/ggdisplay.c (preloaded in front of cob_display) writes those as IBM documents; anything it does not model (floating point) is marked GGDISPLAY-NOT-MODELLED and that run's SYSOUT is reported as not compared, never compared against GnuCOBOL's text. - Java side: a generated batch runtime class Sysout (display, displayNoAdvancing, number: IBM's text of a numeric item). The harness points it at a per-run file. - compare_run compares SYSOUT line by line, trailing blanks aside (a SYSOUT record is blank-padded) and libcob's own messages left out, in every run -- after an abend too. The loop's feedback shows the differing lines. - The port ticket: a DISPLAY is Sysout.display with IBM's exact text (was: "a DISPLAY becomes a log line"); Sysout.java is in the prompt's runtime. - The hand ports: CBACT04C (152 lines; it never DISPLAYed each TCATBAL record, and printed a 9x status wrongly) and CBTRN02C (54 lines) route every DISPLAY through Sysout. CBTRN02C's comparison found a defect of the original: closing DALYREJS reports XREFFILE-STATUS. Kept, documented. Both proven on every run again (20 and 29 runs). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4053: compare a SEND MAP's attributes, colour, highlight, cursor and options The CICS equivalence proof compared each screen's text only: a port that showed an error in the wrong colour, or never put the cursor in the field, was still proven (mutation testing, #4047: deleting the menu's `errmsgColor = DFHRED` survived). - COBOL side: from the symbolic map's bytes, per field, the attribute byte (<f>A / <f>F: one byte), extended colour (<f>C) and highlight (<f>H) and length -1 (<f>L: the cursor), plus the SEND MAP options and CURSOR value the stub logs. The harness's DFHBMSCA holds the EBCDIC bytes, so a byte is its value. X'00' is "not set" (BMS takes the map's own); so is a space: WORKING-STORAGE GnuCOBOL initialised where IBM leaves it undefined (a map the program never cleared) -- nothing is claimed about those bytes. - Java side: CicsTask already records MapSubfields, options and cursor (#4001); compare_events now compares them, in the same terms. - The account view hand port (COACTVWC) never set them: it now ports 1300-SETUP-SCREEN-ATTRS (DFHBMFSE, the cursor, red on a bad or missing filter, the info line's colour) and SEND MAP CURSOR ERASE FREEKB. Proven again on all 11 scenarios; the menu (COMEN01C, the loop's port) was already right and stays proven. The CICS crucible compares subfields in its own pipeline since #4001. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4056 / #4053: tests -- SYSOUT comparison, subfield comparison, the DISPLAY model against IBM's text Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * #4056: TRNRPT's port, re-run through the porting loop on the DISPLAY rule The committed CBTRN03C port (the loop's, 2026-09-30) logged its DISPLAYs, as the ticket then said: not proven once SYSOUT is compared. A model's port is never hand-edited, so the loop ran again from scratch on the new ticket: claude-sonnet-5-5, proven on attempt 2 (447/447 report records, 264/264 SYSOUT lines, 24/24 fault runs). Attempt 1 read the records as IBM037 instead of the data's ISO-8859-1 -- the ticket never states the records' code page -- and the SYSOUT feedback showed it. Unedited; the provenance records both attempts and what it supersedes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ * README refresh: COBOL-to-Java with proof; stale counts, tools and links (#4062) COBOL to Java, which the root README mentioned only as a link to an examples repo: - README.md: "COBOL to Java: ported, then proven" -- the pipeline, each proven CardDemo port (who ported it, runs, COBOL branch coverage, mutants caught), the CICS crucible's 17/17, and what the numbers do not show (GnuCOBOL oracle, development data, no fresh-estate trial yet, 6 of 44 programs). Regression-suite counts re-measured. - gitgalaxy/tools/cobol_to_java/README.md rewritten: it described 11 modules that live in cobol_to_cobol/; now the real pipeline, forges, what each case kind must match, the guardrail's checks, the limits. - tests/cobol_mainframe/readme.md indexes the COBOL-to-Java tests; mutation_testing.md / porting_loop.md carry the post-#4056/#4053 scores and TRNRPT's re-run; the README guide's section order and the evidence roadmap (shipped row, gated first-try-rate row) updated. Staleness found by an audit of the other READMEs, each checked against the code: - github-action-readme.md: action tools that do not exist (ai-appsec-sensor, dev-agent-firewall -> galaxyscope --ai-guardrails), the SBOM upload glob (*_sbom.json), 13 vectors, full_precision's real installs, no emoji headings. - security/README.md: the XGBoost model is not shipped; detectors removed in #1020/#1102; the native graph engine (#3040) replaced the NetworkX/BFS fallback; the network multiplier lives in the supply-chain firewall. - Counts: tests 13,281, 56 signatured / 65 registered languages, 2,406 rule patterns, 13 vectors, 98 signals, crucible pin v1.6.0, 60 s fuse. - The docs-site link 404ed in 9 footers; wrong test file names; the installed commands (cobol-refractor, api-network-map); a broken image. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mutation testing of the proven ports (#4047, epic #4055): does "proven" mean anything, and how much?
What
tests/tools/mutation.py: breaks a proven port one small change at a time (ROR, COR, NEG, AOR, BDM, CON, LIT, RET, DEL; never comments, imports, annotations or logging), drops mutantsjavacrefuses (stillborn), proves the rest, and writesmutation.json/mutation.md: score per operator, the runs that killed each mutant, every survivor.list,run,report,compare;--sample/--seed,--only DIR,--full.equivalence.py run --reuse BASELINEtakes the baseline's COBOL outputs per step only when itsrun.shis byte-identical (else it refuses). It takes the baseline's generated project only when the port covers the same files (else it refuses), and compiles only the port's files with the pom's javac options.--first-differencestops a batch proof at the first differing run.run_cobol_step.docs/language_status/mutation_testing.md; the porting-loop skill points to it.Validation: fast vs
--full, same mutants (mutation.py compare): 386 / 386 agree, 0 differA mutant the normal run kills: ~280 s -> ~10-15 s. A survivor still needs every run (next: one JVM per proof, only if it still agrees).
First scores. CSUTLDTC 69% (131/190), COMEN01C 56% (75/135), batch samples 38-75%. NEG is almost always caught: the main logic is pinned. Survivors are case gaps (CSUTLDTC covers 4/10 branches; unpicked menu options; untested boundaries), harness gaps -- filed: #4053 (screen attributes not compared), #4056 (DISPLAY / SYSOUT not compared) -- and equivalent mutants.
Tests.
tests/cobol_mainframe/test_mutation_tooling.py: operators, sampling, killers per kind, score, the reuse refusals, the direct-JVM gating. Fulltests/tree locally: 13,201 passed.audit_check: all clear.🤖 Generated with Claude Code
https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ