The progress of a PIT run in the log (0.15.0) #26

Merged
mi merged 1 commits from mihoe/progress-log into main 2026-10-03 11:47:57 +02:00
Owner

The Problem

PIT writes nothing between its coverage analysis and its end.
Werkator's first full mutation run on 2026-10-03 took 2 h 24 min, and for more than two hours the log said nothing about how far it was.
The only way to tell was to count PIT's result objects in the heap of the running process with jcmd.

Non-Goals

  • An exact total: PIT's listener interface does not pass the number of mutants, and counting them would mean scanning the classes with PIT's mutation engine, work PIT does anyway.
  • A remaining-time estimate: the last units of a run are often the slowest, so a rate from the first ones would mislead.

The Scenarios

  • @MC-032 a progress line names classes, mutants of about the previous total, and the elapsed time; at most one line a minute.
  • @MC-033 without a finished previous report, or with an unreadable one, the line has no total, and nothing warns.
  • @MC-034 more mutants than in the previous run show that run's count instead of a percentage.
  • @MC-035 the end of the run always writes a last line with the final counts, before the summary.
Verified by

The Solution

  • Progress (package report) holds the counts and writes the lines; it knows no PIT type and takes the time as a parameter, so tests need no clock.
  • The listener reads the previous mutation-crap.json in runStart, before it replaces it with the running marker.
    The total is the sum of the status counts and contradicted mutants of a FINISHED report.
    With time-stamped reports, each run writes its own directory, so there is no previous report.
  • Mutants count distinctly, as the report counts them: MutantAggregator.mutantCount().
    A class reported in several blocks counts once.
  • The elapsed time counts from PIT's own start (ListenerArguments.getStartTime()), so it matches PIT's "Total".
  • The plugin still only observes: it writes lines, nothing else.
  • Version 0.15.0.

🤖 Generated with Claude Code

## The Problem PIT writes nothing between its coverage analysis and its end. Werkator's first full mutation run on 2026-10-03 took 2 h 24 min, and for more than two hours the log said nothing about how far it was. The only way to tell was to count PIT's result objects in the heap of the running process with `jcmd`. ## Non-Goals - An exact total: PIT's listener interface does not pass the number of mutants, and counting them would mean scanning the classes with PIT's mutation engine, work PIT does anyway. - A remaining-time estimate: the last units of a run are often the slowest, so a rate from the first ones would mislead. ## The Scenarios - `@MC-032` a progress line names classes, mutants of about the previous total, and the elapsed time; at most one line a minute. - `@MC-033` without a finished previous report, or with an unreadable one, the line has no total, and nothing warns. - `@MC-034` more mutants than in the previous run show that run's count instead of a percentage. - `@MC-035` the end of the run always writes a last line with the final counts, before the summary. ##### Verified by - [ProgressTest](../../werkcrappit-pit/src/test/java/de/javagil/werkcrappit/pit/report/ProgressTest.java) - [MutationCrapListenerTest](../../werkcrappit-pit/src/test/java/de/javagil/werkcrappit/pit/listener/MutationCrapListenerTest.java) `progressEstimatesTheTotalFromThePreviousReport`, `progressWithoutTotalAfterAnUnfinishedRun`, `theConsoleGetsAFewLinesAndThePathToTheReports` ## The Solution - `Progress` (package `report`) holds the counts and writes the lines; it knows no PIT type and takes the time as a parameter, so tests need no clock. - The listener reads the previous `mutation-crap.json` in `runStart`, before it replaces it with the running marker. The total is the sum of the status counts and contradicted mutants of a `FINISHED` report. With time-stamped reports, each run writes its own directory, so there is no previous report. - Mutants count distinctly, as the report counts them: `MutantAggregator.mutantCount()`. A class reported in several blocks counts once. - The elapsed time counts from PIT's own start (`ListenerArguments.getStartTime()`), so it matches PIT's "Total". - The plugin still only observes: it writes lines, nothing else. - Version 0.15.0. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
mi added 1 commit 2026-10-03 11:42:49 +02:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mi merged commit e31f44c1b4 into main 2026-10-03 11:47:57 +02:00
mi deleted branch mihoe/progress-log 2026-10-03 11:47:57 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkcrappit#26