---
title: "Delete tests with their feature · Agent Wranglers"
url: https://agentwranglers.se/playbook/architecture/structure/delete-tests-with-feature
id: ARC-62
level: Recommended
updated: 2026-10-22
build: a2a6bdfed830
tokens: 551
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Delete tests with their feature

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Structure](https://agentwranglers.se/playbook/architecture/structure.md).

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

- ID: ARC-62
- Level: Recommended
- Chapter: [Structure](https://agentwranglers.se/playbook/architecture/structure.md)
- Rule: When you remove a feature, remove its tests, fixtures and settings in the same change.
- Check: The dead code finder covers test folders too. In review, a removal change also deletes the matching tests.
- How: Search for the feature's name across tests, fixtures, settings and docs before you merge. Tests for removed code keep dead helpers alive and slow every run. It is the reverse of [Ship tests in the same change](https://agentwranglers.se/playbook/testing/test-strategy/tests-with-the-change.md).

## 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.

### Plain text example

```text
Removed: src/gift-cards/, tests/gift-cards/, fixtures/gift-cards.json, GIFT_CARDS_ENABLED
```

## Related rules

- TST-3 [Ship tests in the same change](https://agentwranglers.se/playbook/testing/test-strategy/tests-with-the-change.md) in Testing
- TST-60 [Fail the run when fewer tests run than before](https://agentwranglers.se/playbook/testing/test-quality/test-count-floor.md) in Testing

**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/architecture/structure/delete-tests-with-feature">Agent Wranglers clean code and architecture playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Remove unused dependencies](https://agentwranglers.se/playbook/architecture/structure/remove-unused-dependencies.md)
- [Structure](https://agentwranglers.se/playbook/architecture/structure.md)
