Introducing the 9 Laws of High-Value Tests

Are your tests
helping you ship?
Or slowing you down?

Writing tests doesn't make you faster.
Writing the RIGHT tests does.

Learn the 9 laws of tests worth writing.

The 9 Laws of High-Value Tests

Tests are approximations of user experience. Good approximations increase velocity. Bad ones kill it.

01

Isolation

Tests are hermits

02

Speed

A slow test is already dead

03

Determinism

Flaky tests are worse than no tests

04

Signal Clarity

Fail loudly, fail obviously

05

Focus

One failure reason per test

06

Stability

Tests should survive refactoring

07

Setup Honesty

Every line of setup is a smell

08

Boundaries

Test your code, fake the world

09

Maintenance

Delete tests that don't pull their weight

Here's what bad looks like

Testing Implementation, Not Behavior

😱 This Will Haunt Your CI
// 😱 BAD: Testing internal implementation
test('user service', () => {
  const userService = new UserService();
  const spy = jest.spyOn(userService, 'validateEmail');

  userService.createUser('john@example.com', 'password');

  expect(spy).toHaveBeenCalledWith('john@example.com');
  expect(userService.users.length).toBe(1);
});
✅ Actually Useful Test
// ✅ GOOD: Testing behavior and outcomes
test('creates user with valid email', async () => {
  const result = await createUser('john@example.com', 'password');

  expect(result.success).toBe(true);
  expect(result.user.email).toBe('john@example.com');

  const user = await findUserByEmail('john@example.com');
  expect(user).toBeDefined();
});

Ready to write tests that increase velocity?

Learn which tests are worth writing—and which ones are slowing you down.

Start Learning