Skip to content

Commit 309fc26

Browse files
committed
docs: add testing doctrine to AGENTS.md
1 parent 80bf00f commit 309fc26

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

AGENTS.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Production-style contracts for gas benchmarks only. Raw vs quantized pairs: `Raw
4444

4545
## Conventions
4646

47-
- Solidity `^0.8.25`, 4-space indentation, NatSpec on public-facing behavior.
47+
- Solidity `^0.8.33`, 4-space indentation, NatSpec on public-facing behavior.
4848
- Errors are file-level with bare names (not namespaced inside the library).
4949
- Create schemes with `UintQuantizationLib.create(...)`; never use `Quant.wrap(...)` directly.
5050
- Showcase pairs follow `Raw...` / `Quantized...` naming.
@@ -53,6 +53,19 @@ Production-style contracts for gas benchmarks only. Raw vs quantized pairs: `Raw
5353
- Conventional Commits: `feat:`, `fix:`, `ci:`, `docs:`, `chore:`, `refactor:`, `perf:`.
5454
- If gas numbers change, include before/after output from the showcase gas report.
5555

56+
## Testing doctrine
57+
58+
A test is worth keeping if it protects against a plausible future regression that a reviewer could miss. Write a test when at least one is true:
59+
60+
1. It explores more of the input space than review will (fuzz/property tests, parameterized ranges).
61+
2. It pins a singular boundary where arithmetic or bit logic tends to fail (0, 1, max, first invalid value).
62+
3. It captures a non-local contract (constructor invariants, checked vs unchecked semantics, round-trip relationships).
63+
4. It documents a user-visible revert condition with non-trivial control flow.
64+
5. It prevents a known regression or a previously identified review finding.
65+
6. It serves as executable documentation for a tricky public semantic (one golden test per semantic, not per function).
66+
67+
Do not write a test that re-implements the function under test, proves the language works as documented, or duplicates coverage from a stronger fuzz/property test. For one-liners, prefer testing through richer invariants.
68+
5669
## Release pipeline
5770

5871
Fully automated on push to main (`.github/workflows/release.yml`):

0 commit comments

Comments
 (0)