mmntjs
Compatibility-first migration bridge away from moment.js

Quality

Quality means preserving semantics, not just passing unit tests.

For a compatibility-focused date library, quality work is about semantic equivalence, regression preservation, and honest handling of edge cases.

Evidence

  • 678/678 moment.js compatibility tests passing
  • Differential oracle tests and property-based comparisons
  • Coverage-guided fuzzing plus grammar-based ISO generation
  • DST and timezone boundary tests across multiple timezones
  • Regression fixtures for previously discovered edge cases
  • TZ-sensitive test runs in UTC and non-UTC environments

Philosophy

  • Behavior snapshots matter more than isolated implementation coverage.
  • Known differences should be documented before they surprise users.
  • Timezone, DST, and invalid inputs deserve explicit test strategy, not assumptions.

Current Baseline

Area Value Notes
Upstream compatibility 678/678 moment.js official compatibility tests passing
Hard suite 4642/4642 current tracked baseline passing
Timezone coverage 744/744 124 cases across six timezones
Coverage baseline 73.27% line coverage after the Phase 4 uplift
Mutation 20/20 applicable operators killed
Fuzz harnesses 11 coverage-guided targets in the quick workflow

What Quality Means Here

In a compatibility-oriented library, a passing unit test on a happy path is not enough. Quality means preserving legacy semantics where they are promised, recording discovered edge cases, and resisting the temptation to hand-wave differences as acceptable because they are rare. Rare date/time bugs are often the expensive ones.

The short version: differential testing, regression fixtures, timezone boundary tests, and invalid-input behavior are first-class quality signals. The detailed methodology lives in the repository so reviewers can inspect the actual strategy and historical quality work.

Testing Areas

Differential testing

Use upstream moment.js behavior as the oracle instead of relying on local assumptions.

Edge-case corpus

Preserve previously discovered failures as regression fixtures so migration safety improves over time.

Fuzzing and properties

Explore parsing, formatting, duration, and operation space beyond hand-written examples.

DST and timezone boundaries

Test mode transitions and local-time edge cases where production regressions are expensive.

Release discipline

Treat compatibility changes and known behavior shifts as first-class release notes.

Why This Matters In Migration

  • Legacy systems often rely on undocumented behavior that only differential comparison will reveal.
  • Timezone and DST bugs can pass broad test suites yet still break customer-visible workflows.
  • Regression preservation is what turns one-off bug fixes into growing migration confidence.

Recent Bug Classes Closed

  • keepLocalTime compatibility gaps in UTC/local offset transitions
  • UTC array-input construction and UTC flag propagation
  • invalid-date acceptance caused by missing overflow checks
  • locale parsing over-acceptance in strict month and weekday paths
  • negative zero offset and diff edge-case mismatches

Release Checklist

  • Did this change preserve documented moment.js-compatible behavior?
  • If behavior changed, is the difference explicit in compatibility or changelog docs?
  • Were timezone, invalid-date, and parsing-sensitive paths exercised in at least one realistic test shape?
  • Would a migration reviewer understand the risk of upgrading from the release notes alone?

Detailed Methodology

The command matrix, fuzzing setup, property tests, mutation checks, and coverage notes are maintained in GitHub rather than duplicated here.