test-oracle
Skill4 starsChanged 4 months agoMITView on GitHub
Design test oracles: the procedure that decides pass vs fail for a test case. Child of /unit-tests. Use when defining expected results, assertions, or choosing oracle type for a test, or /test-oracle.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- black-boxSkill
- carry-planSkill
- find-the-argumentSkill
- make-presentation-slideSkill
- mutation-testingSkill
- process-thinking-aloudSkill
- readableSkill
- resume-deep-diveSkill
- review-resumeSkill
- review-skillSkill
- side-quest-recommendSkill
- unit-testsSkill
- white-boxSkill
The file
Files
/test-oracle
Design pass/fail for each test case (Arrange–Act–Assert).
Parent: unit-tests (references/principles.md).
Oracle = procedure comparing actual vs expected to produce a verdict.
Core oracle types
| Type | Example |
| Exact value | assertEquals(300, game.score()) |
| Exception | assertThrows(InvalidOp.class, ...) |
| Invariant | balance > 0 && balance <= MAX |
| Relational/range | greaterThan(0), closeTo(3.14, 0.01) |
| Set/membership | hasEntry("bar", "foo") |
| Boolean | assertTrue / assertFalse |
| Null | assertNull / assertNotNull |
| Matcher (Hamcrest) | assertThat(x, hasItem(...)) — better diagnostics |
Pick the simplest type that works. assertEquals(expected, actual) — expected first.
Design Rules
- Derive expected from spec/contract for this input block.
- One oracle per test purpose (essentiality).
- Oracle must fail when behavior is wrong; use
fail()on stub paths.
Oracle Smells
Redundant assertNotNull before use · hyperassertions (full serialized output) ·
non-failing oracle (passes either way) · asserting internal state not in contract ·
magic expected values without named constants
Output
Per case: oracle type, assertion (one-liner), rationale (spec clause / block).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

