12 of 12 Factors Available

The 12 Factors for Good Tests

A methodology for building test suites that are fast, reliable, and actually useful. Inspired by the 12-Factor App, adapted for test excellence.

01
Isolation

Tests are hermits

No shared state, no dependencies, no execution order.

Read the guide →
02
Clarity

Test names are documentation

test_user_cannot_purchase_alcohol_under_21() beats test_purchase_validation().

Read the guide →
03
Speed

Fast tests get run

Slow tests get skipped. Dead simple.

Read the guide →
04
Determinism

Flaky tests are worse than no tests

Same input, same output. Always.

Read the guide →
05
Focus

One test, one concern

When it fails, you know exactly what broke.

Read the guide →
06
Portability

No 'works on my machine'

Tests run identically everywhere—locally, CI, containers.

Read the guide →
07
Resilience

Tests adapt to refactoring

Test the contract, not the implementation.

Read the guide →
08
Maintenance

Delete bad tests ruthlessly

A bad test is worse than no test.

Read the guide →
09
Boundaries

Mock the edges, not the core

Mock APIs and databases, never your own code.

Read the guide →
10
Data

Test data tells a story

Explicit > magic. Minimal > kitchen sink.

Read the guide →
11
Diagnostics

Failures should scream what's wrong

'Expected 2 items in cart, got 0' beats 'assertion failed'.

Read the guide →
12
Depth

Coverage tells you what ran, not what works

Use mutation testing to verify your tests actually catch bugs.

Read the guide →

Why 12 Factors?

Just like the 12-Factor App methodology revolutionized how we build cloud applications, these 12 factors represent the essential principles for building test suites that don't suck. Each factor addresses a specific testing anti-pattern that we've all suffered through.

Master these factors, and you'll write tests that are actually helpful rather than a burden. Your future self (and your team) will thank you.