# No tautological assertions

- **Pattern:** `ab-000292` (`ai-slop-test-theater.assertion-quality.no-tautology-assertions`)
- **Severity:** critical
- **Lifecycle:** active
- **Last modified:** 2026-04-18
- **Canonical URL:** https://auditbuffet.com/patterns/ab-000292
- **License:** CC-BY-4.0 — attribute to AuditBuffet Pattern Catalog (https://auditbuffet.com/patterns/ab-000292)

## Why it matters

Tautological assertions — `expect(true).toBe(true)`, `assert(true)`, `expect(1).toBe(1)` — are placeholders that AI scaffolding generates and never replaces. They pass unconditionally, so a completely broken implementation looks identical to a working one in your test output. Teams relying on green CI as a signal of correctness are flying blind: the assertion validates the literal `true` you typed, not the behavior of your code. ISO-25010:2011 testability requires assertions that can actually fail when the system under test is defective.

## Severity rationale

Critical because a tautology assertion passes regardless of what the production code does, making the test meaningless as a fault detector.

## Remediation

Search for `expect(true).toBe(true)`, `assert(true)`, and `expect(1).toBe(1)` across all test files and replace each with an assertion against a real value returned or produced by the code under test. Delete the test entirely if the behavior isn't yet defined — a missing test is less dangerous than a permanently-passing fake one:

```ts
// Before: always passes
it('handles edge case', () => {
  expect(true).toBe(true)
})

// After: fails if the production code returns the wrong shape
it('handles empty input', () => {
  expect(parseInput('')).toEqual({ error: 'empty', input: '' })
})
```

## Detection

- **ID:** `no-tautology-assertions`
- **Severity:** `critical`
- **What to look for:** Walk all test files. Before evaluating, extract and quote each assertion line that matches any of these literal patterns: `expect(true).toBe(true)`, `expect(true).toEqual(true)`, `expect(false).toBe(false)`, `expect(1).toBe(1)`, `expect(null).toBe(null)`, `expect(undefined).toBe(undefined)`, `expect('').toBe('')`, `expect(0).toBe(0)`, `assert(true)`, `assert.ok(true)`, `assert.equal(1, 1)`, `expect.assertions(0)`. Count all tautology assertions found.
- **Pass criteria:** 0 tautology assertions in test files. Report: "X test files inspected, 0 tautology assertions found."
- **Fail criteria:** At least 1 tautology assertion exists in any test file.
- **Skip (N/A) when:** Project has 0 test files.
- **Detail on fail:** `"2 tautology assertions: tests/auth.test.ts line 12 'expect(true).toBe(true)' (placeholder never replaced), tests/utils.test.ts line 34 'expect(1).toBe(1)' (always passes)"`
- **Remediation:** Tautology assertions like `expect(true).toBe(true)` are placeholders the AI generated but never replaced — they pass no matter what the production code does. Replace with real assertions or delete the test:

  ```ts
  // Bad: passes regardless of implementation
  it('handles edge case', () => {
    expect(true).toBe(true)  // placeholder
  })

  // Good: assert actual behavior
  it('handles empty input', () => {
    expect(parseInput('')).toEqual({ error: 'empty' })
  })
  ```

## External references

- iso-25010 maintainability.testability

Taxons: code-quality

HTML version: https://auditbuffet.com/patterns/ab-000292
