{"data":{"slug":"discovered-fbbcf5cb9fa51a0d9261db19b3b39eaf9f6e664fb6ec2cc8","title":"Rjv Test Types","summary":"Choose and write the test type that proves a change\u2014end-to-end flow, property test, or differential test\u2014so an agent cannot fool it. Use when selecting or writing tests for a feature, invariant, or rewrite\/migration.","url":"https:\/\/skillshunter.net\/skills\/discovered-fbbcf5cb9fa51a0d9261db19b3b39eaf9f6e664fb6ec2cc8","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-fbbcf5cb9fa51a0d9261db19b3b39eaf9f6e664fb6ec2cc8","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-fbbcf5cb9fa51a0d9261db19b3b39eaf9f6e664fb6ec2cc8.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-fbbcf5cb9fa51a0d9261db19b3b39eaf9f6e664fb6ec2cc8\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before writing tests, drive the running app through the repo's `verify` skill (`rjv-verify-skill`), a browser, a simulator, or an API harness. Ensure inputs come from a generator or a sample of real traffic, never hand-picked.","instructions":"---\nname: rjv-test-types\ndescription: \"How-to: choose and write the test type that proves a change\u2014end-to-end flow, property test or differential test\u2014so an agent cannot fool it. Use when choosing or writing tests for a feature, invariant (money, balances, parsing, retries) or rewrite\/migration. Verification phases live in rjv-verify; criterion mapping in rjv-spec-driven.\"\n---\n\n# Test types that keep agents honest\n\nA test the agent wrote with the same blind spots as its code proves\nlittle. Pick the type whose inputs or oracle the agent did not choose.\n\n## Pick the type\n\n```text\nDoes a user or caller go through a flow (pages, API calls, a job)?\n\u251c\u2500\u2500 Yes \u2192 end-to-end test, always\n\u2514\u2500\u2500 No\n    Is there a rule that must hold for every input?\n    \u251c\u2500\u2500 Yes \u2192 property test\n    \u2514\u2500\u2500 No\n        Is an old system doing the same job?\n        \u251c\u2500\u2500 Yes \u2192 differential test\n        \u2514\u2500\u2500 No \u2192 unit test on the public function, real inputs\n```\n\nMore than one branch can apply. A money feature usually gets an\nend-to-end flow and a property test for its invariant.\n\n## End-to-end\n\nPick this first when you can only afford one type. Either the whole\nfeature works or it does not, and a failure shows what broke.\n\n- Drive the running app through the repo's `verify` skill\n  (`rjv-verify-skill`), a browser, a simulator or an API harness.\n- Assert on what the user sees or the caller receives, never on\n  internal calls.\n- Use the repo's feature map as the rubric: each flow with its path,\n  selectors and expected result.\n\n## Property\n\nWrite a statement that must never fail and let a library generate\nthousands of inputs against it: fast-check (JS\/TS), Hypothesis\n(Python), proptest (Rust), PHP's Eris or a seeded loop.\n\n| Property | Example |\n|---|---|\n| round trip | decode(encode(x)) equals x; parse(format(x)) equals x |\n| invariant | a balance never goes negative; units times NAV equals amount, within rounding |\n| idempotency | running a migration, retry or webhook twice equals running it once |\n| equivalence | the optimised function equals the naive one |\n\nUse it for every money rule and every parser. It is also the proof to\nuse when a spec has drifted from production behaviour.\n\n## Differential\n\nRun the old and new system on the same inputs and compare. Use it for\nrewrites, migrations and framework swaps that must not change\nbehaviour.\n\n- Inputs come from a generator or a sample of real traffic, never\n  hand-picked.\n- Normalise what does not matter: whitespace, key order, timestamps,\n  generated IDs.\n- Keep an approved-differences list, one line per difference with its\n  reason. Any other difference is a bug.\n\n## Failure modes\n\n- **Flaky** tests teach agents to rerun instead of fix. Root-cause or\n  delete (`rjv-verify` phase 3).\n- **Slow** tests get run less often, so a failure cannot be traced to\n  one change. Keep the per-edit set under a minute; heavy suites run\n  once before the commit.\n\nDone when each promised behaviour has a test of the type the tree\npicked, and the test fails when the behaviour is broken.\n","use_cases":["Selecting the appropriate test type for a feature or invariant","Writing end-to-end tests for user flows or API interactions","Implementing property tests for invariants like money rules or parsing logic","Running differential tests during rewrites, migrations, or framework swaps"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/rjvim\/ai-skills\/blob\/9a942086adef21dbd0c061d9d9e8fd5f43328bf6\/skills\/rjv-test-types\/SKILL.md","source_commit":"9a942086adef21dbd0c061d9d9e8fd5f43328bf6","license":null,"version":null,"listing_approved_at":"2026-12-03","created_at":"2026-12-02T09:10:06.000000Z","updated_at":"2026-12-03T16:19:55.000000Z","seo_title":"How to Choose and Write Test Types for Verification","seo_description":"Learn how to select and write test types\u2014end-to-end, property, or differential\u2014to ensure changes are proven and agents cannot fool the tests. Ideal for features, invarinb","seo_keywords":["end-to-end testing","property testing","differential testing","test types","verification","invariant testing","test selection","test writing"]}}