Back to feed
Dev.to
Dev.to
7/2/2026
My tests were green. My code was wrong. The spec was 3,000 years old.

My tests were green. My code was wrong. The spec was 3,000 years old.

Short summary

Testing in underspecified domains hits the self-validation paradox: your tests encode your code's assumptions, so both pass together even if both are wrong. The author solves this using differential testing—running a large sample of inputs against multiple independent implementations and comparing field-by-field until all agree. With fixed random seeds for reproducibility and separate tests per concern, this pattern generalizes beyond I Ching to any domain where specs are ambiguous.

  • Self-validation paradox: tests written from same misconceptions as code don't catch errors
  • Solution: differential testing against independent oracles (other implementations)
  • Use fixed random seeds and per-concern separation for reproducible, comprehensive validation

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more