Composable Tests

How to reduce test redundancy while maintaining specificity and confidence

Isolation and composition are distinct test properties: isolation means each test sets up its own fixture independently, while composition means a suite of tests together provides predictive confidence even if individual tests aren't comprehensive. By trimming redundant assertions and separating orthogonal dimensions (like computation vs. reporting logic), you can cut test count dramatically—from N×M to N+M+1—while improving readability, specificity, and resilience to structural changes.

Read full essay on Substack ↗

Questions this essay answers

  • Should I delete redundant tests or refactor them into a more composed form?
  • How can I test 4 computation methods × 5 reporting methods without writing 20 tests?
  • What's the difference between test isolation and test composition?
← All essays