Add mutation testing analysis and configuration#56
Merged
Conversation
Ran cargo-mutants against the full workspace (788 mutants tested, 367 missed, 389 caught, 30 unviable, 2 timeouts). MUTANTS.md documents the findings. The headline result is that eleven individual chain-verification check functions (time validity, basic constraints, critical extensions, duplicate extensions, name constraint placement, name constraint enforcement, keyCertSign, RFC 5280 strict rules, CRL strict rules, and the entire WebPKI policy layer) can be replaced with no-ops without any test failing. The existing negative tests fail for multiple reasons at once, so disabling any single check goes unnoticed. Other gaps: ip_matches_constraint / email_matches_constraint can be hard-coded true; the dns_names() / ip_addresses() / curve() convenience methods are entirely untested; DN special-character escaping and the DateTime month table have no coverage. Also adds: - .cargo/mutants.toml excluding CLI color helpers, the base64 line-wrap loop (mutations create infinite loops), and host- filesystem-dependent trust-store discovery. - /mutants.out* to .gitignore.
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.
Summary
This PR adds comprehensive mutation testing analysis and configuration to improve test coverage visibility and guide future testing efforts.
Changes
Added
MUTANTS.md: A detailed mutation testing report generated bycargo-mutantsthat documents:xcert-lib)curve(),dns_names(),ip_addresses())Added
.cargo/mutants.toml: Configuration to exclude known non-testable code from future mutation runs:base64_wrapfunction (mutations cause infinite loops)Updated
.gitignore: Added/mutants.out*to ignore mutation testing output artifactsNotable Findings
The analysis reveals that while individual parsing and utility functions are well-tested, the verification pipeline has significant gaps:
The report provides actionable guidance for improving test coverage, with the highest priority being per-check negative tests for the verification pipeline.
https://preview.claude.ai/code/session_01QYgbDNhxKkJi6qg2cQqWaN