---
title: "Make sure tests an agent wrote do not just · Agent Wranglers"
url: https://agentwranglers.se/playbook/testing/test-quality/tautological-tests
id: TST-64
level: Recommended
updated: 2026-10-22
build: a2a6bdfed830
tokens: 980
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Make sure tests an agent wrote do not just repeat the code

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Test quality](https://agentwranglers.se/playbook/testing/test-quality.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: TST-64
- Level: Recommended
- Chapter: [Test quality](https://agentwranglers.se/playbook/testing/test-quality.md)
- Rule: Before merging tests that a coding agent wrote, fail any test whose expected value comes from the code under test. Also fail tests that only check that a fake returns what it was told.
- Check: Mutation testing on the files a pull request changes meets the project's mutation score floor. Every new test kills at least one mutant. A lint or review script fails an assertion whose expected side calls the function under test.
- How: An agent asked to add tests often writes ones that pass whatever the code does. It computes the expected value by calling the same function, or copies the current output into the assertion. It may also assert on a mock it set up two lines earlier. Such tests raise coverage and catch nothing. Write expected values as literals worked out by hand or from the requirement. For example, 2 items at 10.00 with 25 percent VAT total 25.00. Run [mutation testing](https://agentwranglers.se/playbook/testing/test-quality/mutation-testing.md) on the changed files, because a tautological test lets every mutant survive. Review the agent's diff for weakened tests, as [Look for weakened checks and skipped work](https://agentwranglers.se/playbook/ai-assisted-development/reviewing-agent-output/no-weakened-checks.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### Python example

```python
# Bad: the expected value comes from the code under test, so it can never fail
def test_order_total():
    order = Order(items=[Item(price=10), Item(price=10)], vat_rate=0.25)
    assert order.total() == order.total()

# Bad: only checks that the fake returns what it was told
def test_charge(mocker):
    gateway = mocker.Mock(charge=mocker.Mock(return_value="ok"))
    assert gateway.charge(25) == "ok"

# Good: the expected value is worked out by hand from the requirement
def test_order_total_includes_vat():
    order = Order(items=[Item(price=10), Item(price=10)], vat_rate=0.25)
    assert order.total() == 25
```

### TypeScript example

```ts
// Bad: calcTotal is both the code under test and the source of the answer
test('order total', () => {
  const order = { items: [{ price: 10 }, { price: 10 }], vatRate: 0.25 };
  expect(calcTotal(order)).toBe(calcTotal(order));
});

// Good
test('order total includes VAT', () => {
  expect(calcTotal({ items: [{ price: 10 }, { price: 10 }], vatRate: 0.25 })).toBe(25);
});
```

## Related rules

- TST-31 [Prove the tests catch bugs](https://agentwranglers.se/playbook/testing/test-quality/mutation-testing.md) in Testing
- AID-18 [Look for weakened checks and skipped work](https://agentwranglers.se/playbook/ai-assisted-development/reviewing-agent-output/no-weakened-checks.md) in AI-assisted development

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/testing/test-quality/tautological-tests">Agent Wranglers testing playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Fail the run when fewer tests run than before](https://agentwranglers.se/playbook/testing/test-quality/test-count-floor.md)
- [Test quality](https://agentwranglers.se/playbook/testing/test-quality.md)
