Three pure decision arms nothing chooses: ConcatStrategy's height check, an image spec carrying a codec, isPureRemux's all-NONE case #264

Open
opened 2026-09-07 16:51:17 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-09-07 16:51:17 +00:00 (Migrated from github.com)

Found by the union coverage read of 2026-09-07 (E9 in docs/e2e-read-findings.md). Three arms
neither suite takes, all on lines both suites fully execute, all in pure functions a test can call
directly. Grouped because the work is identical in shape and small in each case — split if that
turns out wrong.

1. ConcatStrategy.kt:57 — the dimension check's second half

if (inputs.any { it.width != first.width || it.height != first.height }) {

Six branches, one missed. The likely candidate is same width, different height: in an || the
height comparison is only evaluated when the widths match, and every multi-input fixture varies both
together or neither. Confirm which of the six before writing the test — the sibling checks at :51,
:55 and :60 are fully covered, so the shape is already established next door.

Mutation: change it.height != first.height to false. A test with two inputs of equal width
and differing height must then fail, because the strategy comes back STREAM_COPY instead of
REENCODE.

2. ContainerCapabilities.kt:122 — an image output carrying a codec

if (spec.isImageOutput) {
    return if (spec.videoCodec == VideoCodec.NONE && spec.audioCodec == AudioCodec.NONE) {

The missed arm is an image output (GIF / IMAGE_SEQUENCE) whose spec carries a non-NONE
codec, i.e. the Validation.Invalid return. validate is public and takes a plain OutputSpec, so
this is a direct call. Check first whether the Advanced picker can actually produce such a spec; if
it cannot, this is F4-shaped and belongs in docs/coverage-read-findings.md instead.

Mutation: replace the condition with true. The test asserting the refusal must go red.

3. OutputFormat.kt:103 — isPureRemux's third condition

get() = videoCodec.isCopyOrAbsent() &&
    audioCodec.isCopyOrAbsent() &&
    (videoCodec == VideoCodec.COPY || audioCodec == AudioCodec.COPY)

The third line exists to stop NONE+NONE counting as a remux. One of its four branches is never
taken. Determine which — the interesting case is a spec where both tracks are NONE, which must
answer false.

Mutation: delete the third condition entirely. A test asserting isPureRemux == false for an
all-NONE spec must go red.

Note

All three are model-package decision code, which CLAUDE.md describes as "where one branch is one
documented user-visible outcome". That is the argument for closing them rather than exempting them.

Found by the union coverage read of 2026-09-07 (E9 in `docs/e2e-read-findings.md`). Three arms neither suite takes, all on lines both suites fully execute, all in pure functions a test can call directly. Grouped because the work is identical in shape and small in each case — split if that turns out wrong. ## 1. `ConcatStrategy.kt:57` — the dimension check's second half ```kotlin if (inputs.any { it.width != first.width || it.height != first.height }) { ``` Six branches, one missed. The likely candidate is **same width, different height**: in an `||` the height comparison is only evaluated when the widths match, and every multi-input fixture varies both together or neither. Confirm which of the six before writing the test — the sibling checks at `:51`, `:55` and `:60` are fully covered, so the shape is already established next door. **Mutation:** change `it.height != first.height` to `false`. A test with two inputs of equal width and differing height must then fail, because the strategy comes back `STREAM_COPY` instead of `REENCODE`. ## 2. `ContainerCapabilities.kt:122` — an image output carrying a codec ```kotlin if (spec.isImageOutput) { return if (spec.videoCodec == VideoCodec.NONE && spec.audioCodec == AudioCodec.NONE) { ``` The missed arm is an image output (`GIF` / `IMAGE_SEQUENCE`) whose spec carries a **non-`NONE`** codec, i.e. the `Validation.Invalid` return. `validate` is public and takes a plain `OutputSpec`, so this is a direct call. Check first whether the Advanced picker can actually produce such a spec; if it cannot, this is F4-shaped and belongs in `docs/coverage-read-findings.md` instead. **Mutation:** replace the condition with `true`. The test asserting the refusal must go red. ## 3. `OutputFormat.kt:103` — `isPureRemux`'s third condition ```kotlin get() = videoCodec.isCopyOrAbsent() && audioCodec.isCopyOrAbsent() && (videoCodec == VideoCodec.COPY || audioCodec == AudioCodec.COPY) ``` The third line exists to stop `NONE`+`NONE` counting as a remux. One of its four branches is never taken. Determine which — the interesting case is a spec where both tracks are `NONE`, which must answer **false**. **Mutation:** delete the third condition entirely. A test asserting `isPureRemux == false` for an all-`NONE` spec must go red. ## Note All three are `model`-package decision code, which `CLAUDE.md` describes as "where one branch is one documented user-visible outcome". That is the argument for closing them rather than exempting them.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMediaConverter#264