| name | test-discipline |
| description | Keep tests, validation scripts, and expectations aligned with behavior changes |
| domain | quality |
| confidence | high |
| source | template |
Context
When behavior changes, verification must change with it. Tests and validation scripts should be updated in the same change so the repository stays trustworthy.
Patterns
- Update tests or validation scripts whenever you change public behavior, data formats, or commands
- Keep expected counts, snapshots, and fixture data in sync with the files and outputs they describe
- If a validation step fails after your change, verify the assertions and fixtures before assuming the code is wrong
- Do not leave follow-up test work for a separate commit when the implementation already changed behavior
Examples
✓ Good:
- Updating a parser and the fixtures that exercise it in the same pull request
- Changing generated JSON shape and updating validation expectations immediately
- Adding a new documented command and updating the script that validates links or references
✗ Poor:
- "Code first, tests later"
- Adding files without updating the assertions that enumerate them
- Declaring success without running the existing validation step
Anti-patterns
- Treating tests as optional after interface changes
- Ignoring failing assertions that were made stale by your edit
- Shipping docs or data changes without checking the existing validation workflow