test-driven-development — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited test-driven-development (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Write the test before the code, watch it fail, then write only enough code to make it pass. The point of seeing it fail first is simple: a test you never watched fail might be testing nothing. Tests written after the fact pass immediately, and a test that has only ever passed proves nothing about whether it would catch the bug.
No production code without a failing test that demands it. If you wrote the implementation first, the honest move is to delete it and start from the test — not keep it "as reference" and reconstruct it, which is just testing-after wearing a costume. Implement fresh from what the test asks for.
Exceptions worth asking the user about: throwaway prototypes, generated code, pure config. Everything else — features, bugfixes, behaviour changes — goes test-first. The thought "I'll skip TDD just this once" is the rationalisation this skill exists to catch.
Write a single test for one behaviour, with a name that describes that behaviour. Exercise the real code, not a mock of it — a test that asserts a mock was called tests the mock, not your logic. Mock only what you genuinely can't run (network, clock, filesystem) and only when unavoidable.
Good: test('retries a failed operation three times before giving up') — clear name, one behaviour, real code path. Avoid: test('retry works') driving a pre-scripted mock — vague, and it verifies the mock's script rather than the implementation.
Run the test. This step is not optional. Confirm it fails (not errors out on a typo or import), and that it fails because the behaviour is missing — the assertion you expect, not "function not defined" hiding a different problem. If it passes, you're testing something that already exists; fix the test. If it errors, fix the error and re-run until it fails cleanly.
Write the simplest thing that makes the test pass. No extra options, no configurability nobody asked for, no "while I'm here" features. Resist designing for imagined future needs — the next test will pull the design forward when it's actually needed.
Run it again. Confirm this test passes, every other test still passes, and the output is clean (no new warnings or stray logs). If your test fails, fix the code, not the test. If a different test broke, fix that now.
Only once green: remove duplication, improve names, extract helpers. Keep the tests passing the whole time and don't add new behaviour here — new behaviour means a new red test.
Then repeat for the next behaviour.
Tests written after the code are shaped by the code: you test what you happened to build, verify the edge cases you happened to remember, and never watch the test catch anything. Tests written first force you to state what the code should do and to discover edge cases before they're buried in an implementation. "Thirty minutes of tests afterward" gets you coverage but throws away the proof that the tests work.
If a test is hard to write, listen to it — hard to test usually means hard to use, or too tightly coupled. That's design feedback, not a reason to skip the test.
A bug is a missing test. Write a test that reproduces the bug and fails, then fix the code until it passes. Now the fix is proven and the regression can't silently come back. Never fix a bug without first having a test that fails because of it.
Can't tick every box? You drifted off TDD — go back to the last green point and restart test-first from there.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.