How do you check that your tests notice changes in MAVLink input handling?

I planted 40 small changes (mutations) in the MAVLink C parser (c_library_v2, commit 56f6435e) and ran my test setup against each one. It caught 22 and missed 18. I documented every miss one by one, and the results are hash chained and signed, so anyone can check that nothing was changed afterwards.

For those who ship PX4 or ArduPilot based products: how do you check that your tests notice changes in MAVLink input handling? I would like to learn what works and what does not. If it is useful, I can share the one page report.

This is a very interesting way of testing the test system itself rather than only the parser.

The 18 surviving mutations are probably the most useful part of the result. I’d be interested in whether they cluster around particular input-handling behaviours for example framing/length handling, CRC validation, field interpretation, parser state transitions, or malformed/truncated input.

I’d also be interested in the distinction between:

mutation introduced → observable parser behaviour changed → test oracle had sufficient evidence to detect it → mutation detected/missed

A surviving mutation does not necessarily mean the same thing in every case: some may be equivalent or operationally irrelevant, while others may expose a genuine blind spot in the test oracle.

The hash-chained record is particularly useful here because it makes the experiment itself independently auditable.

Yes, please share the one-page report. I’d be interested in looking at the 18 misses and seeing whether they can be classified by the first observable divergence and the evidence the existing tests were missing.

Thanks again. I ran a targeted follow up on the 18 survivors: one purpose built input per mutation, original against mutant, same flags, with address and undefined behaviour sanitizers. For 15 of the 18 I found an input where the mutant differs observably from the original, so these are not equivalent mutants. For 3 (a stack array size and two binary search variants) I found no difference after three attempts, and I treat them as equivalent candidates argued from source. This analysis is not yet part of the signed record, and I will add it before I call it final. The first observable divergence falls into these kinds: sanitizer crash (2), different bytes on the send path (3), a return value (1), parsed field values such as system or target id (3), frame accepted or rejected and parser state (2), payload content after zero fill (1), a length value updated per byte (1), a checksum field of a rejected frame (2). Most of these need an observation point that a plain fuzz harness without assertions does not have. Does this match what you would expect, and where would you cut the categories differently? I can send the one page report.

Yes this is broadly what I would expect, and the 15/18 observable result makes the distinction much clearer.

I might cut the categories slightly differently, based on the first evidence boundary at which the mutation becomes observable rather than the particular variable that changed:

1. Runtime / memory integrity
Sanitizer-visible crashes or UB.

2. Protocol acceptance / parser state
Frame accepted vs rejected, parser-state transitions, per-byte length/checksum state.

3. Semantic decode
Return values, system/target IDs, decoded fields, and payload content such as the zero-fill case.

4. Outbound representation
Different bytes produced on the send path.

The reason I like that split is that each category implies a different test oracle. A crash-only fuzz harness can observe part of category 1, but may be completely blind to valid-but-different behaviour in 2–4 unless those states/outputs are asserted explicitly.

I would also keep the three equivalent candidates separate rather than counting them as test misses until equivalence is established more strongly. Your current wording “equivalent candidates” seems appropriately cautious.

One additional field that could make the final record particularly useful would be, for every mutation:

mutation → triggering input → first observable divergence → required observation point/oracle → detected by existing suite?

That would turn the mutation results into a map of where the current test evidence is insufficient, rather than only a mutation score.

Yes, please send the one-page report. I’d be very interested in reviewing it.

Thank you, this is very helpful. I like your split by the first point where a mutation becomes observable, because each category needs a different test oracle. I sorted the 15 observable survivors into your four categories: 2 runtime and memory integrity, 6 protocol acceptance and parser state, 5 semantic decode, 2 outbound representation. The 3 equivalent candidates stay separate and are not counted as misses.

Next I will add your field chain for every mutation: mutation, triggering input, first observable divergence, required observation point, detected by the existing suite or not.

The one page report is attached. If you see a survivor where my classification looks wrong, I would like to know which one.

mavlink_mutation_probe_one_page.pdf (52.7 KB)

Hi Yannik,

Thanks for putting this together. The 2 / 6 / 5 / 2 distribution is a useful result, and I agree with keeping the three equivalence candidates separate from confirmed test misses.

One interesting observation is that 13 of the 15 observable mutations fall outside the runtime/memory category. That makes the distinction between crash detection and behavioural test oracles particularly relevant.

For the individual survivor review, I would focus especially on the boundary between protocol acceptance/parser state and semantic decode.

A mutation that changes whether a frame is accepted belongs to the former; one that preserves acceptance but changes the interpreted message content belongs to the latter.

I would also avoid treating the three equivalence candidates as proven equivalent without a stronger argument about reachability and observable behaviour.

The proposed mutation → triggering input → first divergence → required oracle → existing-suite detection chain should make these distinctions much easier to verify.

I haven’t yet completed a line-by-line review of the attached report, so I wouldn’t want to flag any specific survivor prematurely.

Thanks again for sharing the results. This is developing into a useful evidence-based assessment of MAVLink test coverage.

Hi Yannik,

Thank you for sharing the one-page report. I have now reviewed the results and the classification table.

Overall, I think the four-category structure is consistent with the evidence presented. I would not reclassify any specific survivor based on the summary alone, but there are several points worth tightening in the per-mutation record.

1. Two different mutations at line 429

Line 429 appears in both runtime/memory integrity (|| → &&) and protocol acceptance (> → >=).

That is not inherently inconsistent. Different mutations at the same source location can have different first observable divergences.

I suggest using a unique mutation ID alongside the line number, operator change and triggering input. This would make the classification independently auditable.

2. Protocol acceptance versus semantic decode

The distinction looks appropriate in your examples:

  • A frame being rejected as BAD instead of accepted is a protocol acceptance divergence.

  • A payload being filled with 01 instead of 00 is a semantic/content divergence, provided the frame acceptance behaviour remains unchanged.

For each case, it would be useful to record the earliest observation point that actually differs, rather than only the final output.

3. Detection variability: 21 versus 22

The unexplained difference between earlier runs is worth investigating before treating 22/40 as a stable detection result.

I would record the mutation responsible for the variation, the triggering corpus input, execution settings and whether the outcome reproduces under a deterministic replay.

4. Build-configuration sensitivity

The report notes that two survivors require a non-default build flag or a particular frame shape.

I suggest recording the build configuration as part of the evidence for each mutation. Otherwise, a configuration-dependent blind spot might be mistaken for a general limitation of the test oracle.

5. The three equivalence candidates

I agree with keeping these separate.

Three attempts producing identical output are useful negative observations, but do not establish semantic equivalence. The next step would be to examine reachability and the relevant observation boundaries.

One additional suggestion: distinguish between a mutation detected by the existing fuzz harness and one whose divergence was demonstrated only by the targeted follow-up probe.

That distinction is central to the question your report is asking: not merely whether a mutation changes behaviour, but whether the existing tests notice that change.

Your proposed per-mutation chain should provide exactly the evidence needed:

mutation → triggering input → first observable divergence → required oracle → existing-suite detection

I think this is a strong direction for making test coverage limitations reproducible and actionable.

Thanks again for the careful work and for being explicit about the study’s limitations.

Hi yigitcan, thank you for the careful read. Here is the per mutation chain you suggested, 18 rows, one per surviving mutation. Each row has a number, so the two mutations at line 429 are now #5 and #6. The category is my own classification, not a measurement. The observation point is the earliest place where original and mutant differ, taken from my probe output.

#1, line 89, 0 to 1: return value of mavlink_sign_packet. Category 3 Semantic decode.

#2, line 241, >= to >: sanitizer (ASan abort, WRITE of size 4, mavlink_helpers.h:252). Category 1 Runtime / memory integrity.

#3, line 418, 2 to 3: none found. Equivalent candidate, not proven.

#4, line 424, && to or: bytes sent (checksum over sent buffer). Category 4 Outbound representation.

#5, line 429, > to >=: bytes sent and parse error flag. Category 2 Protocol acceptance / parser state.

#6, line 429, or to &&: sanitizer (ASan abort, READ of size 1, checksum.h:70). Category 1 Runtime / memory integrity.

#7, line 441, 255 to 256: bytes sent (count). Category 4 Outbound representation.

#8, line 591, 1 to 2: none found. Equivalent candidate, not proven.

#9, line 596, > to >=: none found. Equivalent candidate, not proven.

#10, line 673, >= to >: return value of mavlink_msg_get_target_sysid. Category 3 Semantic decode.

#11, line 826, 24 to 25: decoded field (sysid). Category 3 Semantic decode.

#12, line 847, or to &&: frame accepted or not, needs build flag MAVLINK_CHECK_MESSAGE_LENGTH. Category 2 Protocol acceptance / parser state.

#13, line 893, 8 to 9: decoded field (target id). Category 3 Semantic decode.

#14, line 907, 0 to 1: frame accepted or rejected (parse error flag). Category 2 Protocol acceptance / parser state.

#15, line 946, 0 to 1: decoded payload content (zero fill). Category 3 Semantic decode.

#16, line 1036, != to ==: parser state, only visible through a running length sum I added to my own harness. Category 2 Protocol acceptance / parser state.

#17, line 1049, == to !=: checksum field of the rejected frame. Category 2 Protocol acceptance / parser state.

#18, line 1058, 8 to 9: checksum field of the rejected frame. Category 2 Protocol acceptance / parser state.

On your other points: all 18 survived my existing fuzz harness, and every divergence above was shown only by a targeted follow up probe, so none of them counts as detected by the existing suite. Rows 12 and 16 are configuration dependent, so I will add a build configuration column for all rows. The 21 versus 22 difference is still unexplained. I have four full runs, two at 21 and two at 22, and I have not yet identified which mutation flips. I will do a deterministic replay and report back here, and I will not treat 22 of 40 as a stable number until then.

Hi yigitcan, a short update on the 21 vs 22 question.

I replayed the mutation at line 1014 (!= to == in the receive path) on a copy of the target with the same harness and the same sanitizer flags. One difference to the original runs: g++ instead of clang++.

Measured results:

Result 1: none of 16 single corpus files triggers it (3 repeats each, deterministic).

Result 2: the 4 fuzz corpora on their own (n 207, 196, 210, 207) do not trigger it either.

Result 3: the 219 seed files alone do trigger it, and so do seeds plus each of the 4 corpora.

So corpus size is not the cause. Why two earlier runs showed 21 is still open. Next I replay with the original clang++ build and the harness version of 3 Oct. Until then I do not treat 22 of 40 as a stable number.

The build column is ready as a file. Only row 847 needs an extra define (MAVLINK_CHECK_MESSAGE_LENGTH).

Hi Yannik,

Thanks for the detailed per-mutation chain and the follow-up replay results. This is becoming a much more useful and auditable record.

I have two observations.

1. Mutation #1 — classification boundary

For line 89 (0 → 1), the first observable difference is the return value of mavlink_sign_packet.

I wonder whether “Semantic decode” is the most precise category here, since the divergence appears to concern signing/API behaviour rather than decoding.

Would it make sense to broaden Category 3 to “Semantic/API behaviour”, or keep a separate distinction in the detailed record?

I would not change the category without checking the actual mutation and triggering input, but this seems worth clarifying.

2. The 21 versus 22 variability

Your replay results are interesting because the 219 seed files trigger the line 1014 mutation, while the individual corpus files and four fuzz corpora do not.

That establishes a corpus-dependent detection result under the replay configuration, but it does not yet explain the original run-to-run difference.

I agree with your plan to repeat the experiment using the original clang++ build and the October 3 harness.

For the comparison, I would preserve the compiler version, sanitizer options, harness revision, corpus contents, execution settings and exact triggering input.

One additional question: was the mutation triggered during the initial corpus replay, or only after fuzzing began? That distinction may help explain the detection variability.

I also appreciate your clarification that all 18 mutations survived the original fuzz harness and that their observable differences were established through targeted follow-up probes.

That is an important distinction between mutation observability and existing test detection.

I would keep the three equivalence candidates unresolved until stronger evidence is available.

Looking forward to the clang++ replay results. I think resolving the variability before publishing a final detection score is the right approach.

Hi yigitcan, thanks for the careful read.

On mutation #1 (line 89): agreed. The first difference is the return value of mavlink_sign_packet (0 in the original, 1 in the mutant, with signing switched off), so this is signing API behaviour and not decoding. I will rename Category 3 to Semantic/API behaviour in the next report version and keep the per mutation detail.

On the 21 vs 22 question: the mutation measurement is not triggered during fuzzing. After the fuzz run, a fixed corpus directory is replayed through the harness. In the runs at 21 that directory was the corpus of the run itself, in the runs at 22 it was the 219 seed files. This is in my previous post (#10). The clang++ replay is done: clang 18.1.3, same sanitizer flags, same harness file hash in all four runs, and 5 of the 219 seeds show the difference when run one by one.

I keep the three equivalence candidates open.

Hi Yannik,

Thanks for the clarification and the clang++ replay results.

That resolves my earlier question about the 21/22 difference: the distinction is in the fixed corpus used for post-fuzz replay, not in when the mutation was triggered during fuzzing.

The five individually reproducing seeds, together with the consistent harness hash and sanitizer configuration, make the result substantially easier to audit.

I also appreciate the Category 3 clarification and your decision to keep the three equivalence candidates unresolved.

From an evidence perspective, this is a useful distinction between a mutation that survives a particular test corpus and one that has no observable behavioural difference.

Looking forward to the updated report.

Best regards,
Yiğitcan

Hi Yiğitcan, thank you for the careful review. Next I will add the build configuration column for all 18 rows, rename category 3 to Semantic/API behaviour and update the report. I will post here when it is ready.

Hi Yannik,

Sounds good, thanks for the update.

Adding the build configuration for all 18 mutations will make the evidence easier to reproduce and independently review.

I look forward to reviewing the updated report when it’s ready.

Best regards,
Yiğitcan

Hi yigitcan,

here is the updated report as a PDF. Short version: 40 mutations, 22 detected, 18 survived. The 22 is the sum of seven per function runs, not one single binary, and line 1014 depends on the seed corpus. Two survivors (591, 596) are equivalent by exhaustive comparison, 418 is still open.

I also wrote tests for the survivors that can be observed. 10 of them are in pymavlink PR 1305. All numbers and limits are in the report.

If something looks wrong to you, please tell me. I would rather fix it than leave it.

mavlink_mutation_probe_summary_v2_sw.pdf (37.2 KB)

Hi Yannik,

Thank you for sharing the updated report. I read both pages carefully.

This is a substantial improvement, particularly the separation between the original 22 detected mutations and the new tests developed for the 15 observable survivors.

I also appreciate that you explicitly distinguish a test that can detect a mutation from evidence that an existing test suite already detects it. That is an important distinction.

A few observations:

  1. The clarification that the 22 detections come from seven per-function runs, together with the corpus dependency at line 1014, makes the result much easier to interpret.

  2. The exhaustive comparison for lines 591 and 596 provides strong evidence within the tested function and output domain. Keeping line 418 open until its equivalence is demonstrated is the appropriate choice.

  3. The new original-versus-mutant assertions are particularly valuable because they turn previously surviving, observable behavioural differences into concrete regression tests.

One point I would suggest strengthening in the next revision is evidence continuity.

You note that the 12 October test results are not yet included in the existing hash chain. It would be useful to link each new test result to its exact source revision, mutation identifier, input, build configuration and recorded outcome, then include those artefacts in an updated evidence manifest.

This would make the new results independently reproducible without changing the meaning of the original 40/22/18 measurement.

I do not see a basis in this summary to challenge the reported counts. The remaining questions are primarily about reproducibility, the scope of the equivalence evidence and eventual integration of the new tests.

Thank you for being so careful about the limitations of the findings.

Best regards,
Yiğitcan Öztürk
PAMILANGA LTD

Hi Yiğitcan,

thank you for reading both pages and for the clear points. On evidence continuity: agreed. I plan to link each new test result to its source revision, mutation ID, input, build configuration and outcome in one manifest, and add it to the chain in a single step, so the original 40/22/18 measurement stays unchanged.

As a first step I will post the build configuration for all 40 mutations here (compiler, flags, sanitizer, corpus, run IDs and source per row). It will also state the known gap: the 22 is the sum of seven per function runs, not one single binary.

Best regards

Yannik

Hi Yannik,

Thank you for the update.

That sounds like a well-structured approach. Preserving the original 40/22/18 measurement while linking the new test evidence through a separate manifest will help maintain a clear and auditable record.

Publishing the per-mutation build configurations and explicitly documenting the seven-run aggregation is also a valuable next step.

I look forward to reviewing the updated evidence once it is available.

Best regards,
Yiğitcan Öztürk
PAMILANGA LTD

Hi Yigitcan, here is the build configuration for the 40 mutations. The forum does not accept CSV files, so I put it inline. The configuration is the same for every row, only the result differs.

Target: mavlink/c_library_v2, commit 56f6435e, file mavlink_helpers.h

Compiler: Ubuntu clang version 18.1.3

Flags: -g -O0 -fsanitize=address,undefined -fno-sanitize-recover=undefined -fno-omit-frame-pointer

Sanitizer: yes

Corpus: corpus_seeds, 219 inputs

Runs: alles_20261003T162139Z and alles_20261003T162603Z (the 22 is the sum of seven per function runs, not one single binary)

Detected (22): M02 to M07, M09, M15 to M20, M24 to M26, M29, M32, M34 to M37

Survived (18): M01, M08, M10 to M14, M21 to M23, M27, M28, M30, M31, M33, M38 to M40

Note on M37 (line 1014): detected in the two runs above, but survived in two earlier runs (alles_20261003T160243Z, alles_20261003T160629Z). Its result depends on the corpus.

The 15 new tests from the pymavlink pull request were measured separately (gcc, assertions, no sanitizer), so that is a different measurement and not comparable to the 22. I will link the per mutation manifest for those once it is final.

Hi Yannik,

Thank you for publishing the build configuration and mutation outcomes.

I checked the mutation ID lists: the 22 detected and 18 surviving cases cover M01–M40 without overlap or omissions.

The explicit compiler flags, corpus size, run identifiers and M37 corpus dependency make the original measurement considerably easier to interpret.

I also appreciate that you have kept the 15 new assertion-based tests separate from the original sanitizer-enabled mutation runs. That distinction is essential for preserving the meaning of the results.

From an evidence-continuity perspective, this is a useful step forward.

I look forward to the finalized per-mutation manifest, particularly the links between mutation definitions, test inputs, build configurations and recorded outcomes.

No additional changes to the original 40/22/18 result seem warranted based on the information shared here.

Best regards,
Yiğitcan Öztürk
PAMILANGA LTD