Skip to content

test: strengthen mutation testing coverage across all modules - #19

Merged
ericodx merged 31 commits into
mainfrom
increase-test-coverage
Apr 6, 2026
Merged

test: strengthen mutation testing coverage across all modules#19
ericodx merged 31 commits into
mainfrom
increase-test-coverage

Conversation

@ericodx

@ericodx ericodx commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add mutation testing configuration (swift-mutation-testing.yml)
  • Strengthen test coverage across 24 existing test files to kill survived mutants
  • Add 10 new test files targeting boundary conditions, edge cases, and extracted test suites
  • Fix SwiftLint and Codespell violations in test files

Key areas targeted from mutation report analysis:

  • CloneDetector: overlap distance boundaries, hash count threshold, subsumption logic, lineCount arithmetic
  • Type4Detector: pre-filter ratio boundaries, similarity threshold, combined 60/40 weighting
  • AnalysisPipeline: multi-criteria sorting (type → file → startLine), tokenizer path branching
  • TextReporter: fragment output lines, clone block separation
  • AnalysisResult: sorting comparator edge cases for equal types, token counts, files, and start lines
  • SemanticNormalizer, GreedyStringTiler, RollingHash, Type3Detector: relational operator boundaries
  • CTokenizer, UnifiedTokenMapper, SuppressionScanner, BaselineStore: boundary and edge case coverage

Type of Change

  • test: Addition or correction of tests.
  • chore: Other changes that do not fit into the previous categories.

Invariants Checklist

  • Detection is deterministic (same input → same output)
  • Source files are never modified (tool is read-only)
  • Source locations are accurate (file, line, column)
  • No false negatives introduced (previously detected clones are still detected)
  • Performance not degraded for large codebases
  • Swift 6 Strict Concurrency compatible
  • Pipeline stages remain stateless pure transformations

Pipeline Impact

Which stages are affected?

  • None

Testing

  • Unit tests added or updated
  • Tests use TokenFactory / TempFileHelper / AnalysisHelper where appropriate
  • Both positive cases (expected clones) and negative cases (false positives to avoid) covered
  • All tests pass locally (swift test) — 715 tests in 61 suites

ericodx added 30 commits April 6, 2026 14:07
@ericodx ericodx self-assigned this Apr 6, 2026
@ericodx ericodx changed the title Increase test coverage test: strengthen mutation testing coverage across all modules Apr 6, 2026
@ericodx ericodx added the test Addition or correction of tests label Apr 6, 2026
@ericodx
ericodx merged commit b03b0fa into main Apr 6, 2026
1 check passed
@ericodx
ericodx deleted the increase-test-coverage branch April 6, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Addition or correction of tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant