Spec-Driven Testing: Verify What Your Coding Agent Built
Kane CLI turns your spec's acceptance criteria into tests, runs them in a real browser, and reports which criteria are proven and which are owed.
npm install -g @testmuai/kane-cli
Trusted by 3M+ users globally at
"We have tripled our tests and are now executing tests in less than 2 hours with 78% Faster Test Execution"
"We figured out a more efficient way to monitor system health and resolve failures earlier in lower environments."
"TestMu AI has significantly boosted our testing speed, is easy to implement, and provides exceptional support."
"With 70% faster test execution, TestMu AI helped us achieve faster time-to-market and enhanced CX."
AI-WRITTEN TESTS
22 of 60 AI Test Suites From Buggy Code Missed the Bug
In an experiment TestMu AI published in October 2026, 27 of 60 suites written from the buggy code caught the bug. From the contract only, 55 caught it and none missed it.
- Gemini 3.1 Pro Preview and 3.8 Flash wrote the suites
- Six small functions, each with one seeded bug
- 120 suites in all: 60 from code, 60 from the contract

Why Does Spec-Driven Development Need Testing?
These checks read the artifacts and code, or test functions with generated inputs. Spec-driven testing runs the app against each criterion and keeps proof.
GitHub Spec Kit v1.3.3
Core commands plan and build the feature. Testing against a running app comes from community extensions.
OpenSpec v1.17.0
A verify step compares the code with the spec, and the validate command checks the spec's structure.
Kiro
Turns EARS requirements into properties, then runs random inputs through the code to test them.
Spec-Driven Testing vs TDD, BDD, Spec-Driven Development
The table compares what each method treats as the source of truth, who writes the test, what decides pass or fail and how coverage is counted.
Spec-driven testing
TDD
BDD (Gherkin)
Spec-driven development, no testing step
Source of truth
The spec, with an ID for each acceptance criterion
The failing unit test
Feature files with Given/When/Then scenarios
spec.md, requirements.md or a change proposal
Who writes the test
Derived from the spec; a person approves the criteria
Developer, before the code
Product, QA and dev together; developers write step definitions
Usually nobody, or the coding agent after the code
What decides pass or fail
A check against the criterion's expected result
Assertions in the unit test
Step definition assertions
Code review, or the agent's own claim
When the spec changes
Changed criteria are flagged and affected tests re-planned for review
Developer edits tests by hand
Feature files edited by hand
Agent regenerates code
Coverage measured by
Criteria proven by a passing run, and criteria still owed
Lines and branches
Scenarios passing
Tasks ticked
Spec-driven testing
Source of truth
The spec, with an ID for each acceptance criterion
Who writes the test
Derived from the spec; a person approves the criteria
What decides pass or fail
A check against the criterion's expected result
When the spec changes
Changed criteria are flagged and affected tests re-planned for review
Coverage measured by
Criteria proven by a passing run, and criteria still owed
TDD
Source of truth
The failing unit test
Who writes the test
Developer, before the code
What decides pass or fail
Assertions in the unit test
When the spec changes
Developer edits tests by hand
Coverage measured by
Lines and branches
BDD (Gherkin)
Source of truth
Feature files with Given/When/Then scenarios
Who writes the test
Product, QA and dev together; developers write step definitions
What decides pass or fail
Step definition assertions
When the spec changes
Feature files edited by hand
Coverage measured by
Scenarios passing
Spec-driven development, no testing step
Source of truth
spec.md, requirements.md or a change proposal
Who writes the test
Usually nobody, or the coding agent after the code
What decides pass or fail
Code review, or the agent's own claim
When the spec changes
Agent regenerates code
Coverage measured by
Tasks ticked
How Does Spec-Driven Testing Work?
Each tab is one Kane CLI command: snapshot the spec, extract its criteria, design the tests, run them, then measure coverage.
Snapshot the Spec as a Hashed Version
kane-cli context ingest saves your spec.md, PRD or ticket as a content-hashed snapshot in a local .context/ store, so every later test traces to an exact version.
Read the Context Docs
Any Spec Format
Markdown and other text, PDF, Word .docx, images, and Jira, Confluence or Linear URLs.
Content-Hashed Versions
Each snapshot is identified by a hash of its bytes, so a changed spec becomes a new version.
CI Mode Saves Only
With --mode ci, ingest lands the files and exits 0 without starting the extract chat.
Spec testability check
Check if a Spec Is Testable With a Free In-Browser Checker
Paste a spec to see which criteria name a result a machine can compare, which use vague words, and which follow EARS patterns.
Rewrite 3 Untestable Criteria in EARS Notation
"Checkout should be fast"
Vague and unmeasured. Rewrite: WHEN the user selects Pay, the app SHALL show the confirmation within 3 seconds.
"Show an error for a bad coupon"
Which error, for which coupon? Rewrite: IF a coupon has expired, THEN the cart SHALL show 'This code has expired'.
"Users can apply discounts"
A capability with no result. Rewrite: WHEN code SAVE10 is applied to a 50.00 cart, the total SHALL show 45.00.
Run Spec-Driven Testing on a GitHub Spec Kit Spec
Kane CLI ingests Spec Kit's spec.md as written. The full run on kane-cli 0.8.18 is in Spec Kit with Claude Code from the command line.
Commands from the Kane CLI assurance loop. Check out our documentation
Now in the Google Antigravity Marketplace
Using Antigravity? Add the TestMu AI plugin, and your agent gets the Kane CLI skill.
Build a Spec Traceability Matrix From Kane CLI Runs
Depth is what a sealed run proved and completeness is what the design still owes. Illustrative example, not output from a real run.
Test
Status
Proof
ac-1 Cart total updates when quantity changes
cart-qty_test.md
Proven
Evidence pack from the passing run
ac-2 Code SAVE10 takes 10% off
cart-coupon_test.md
Designed, not yet run
None yet
ac-3 Free shipping at 50.00 or more
None
Owed
Listed by cover gaps
Test
ac-1 Cart total updates when quantity changes
cart-qty_test.md
ac-2 Code SAVE10 takes 10% off
cart-coupon_test.md
ac-3 Free shipping at 50.00 or more
None
Status
ac-1 Cart total updates when quantity changes
Proven
ac-2 Code SAVE10 takes 10% off
Designed, not yet run
ac-3 Free shipping at 50.00 or more
Owed
Proof
ac-1 Cart total updates when quantity changes
Evidence pack from the passing run
ac-2 Code SAVE10 takes 10% off
None yet
ac-3 Free shipping at 50.00 or more
Listed by cover gaps
4 Techniques for Deriving Test Cases From a Spec
Each derives cases from the spec without reading the code. Kane CLI design covers happy, negative, boundary, edge and security paths.
Equivalence Partitioning
Split the inputs into classes the spec treats alike, then test one value from each class.
Boundary Value Analysis
Test the edges of each range the spec names, such as 49.99, 50.00 and 50.01 for free shipping.
Decision Tables
List every combination of conditions a rule names, with the expected result for each one.
State Transition Testing
Map each state and event the spec describes, then test every allowed and forbidden transition.
Pick a Property-Based or E2E Test per Spec Criterion
Kiro's docs call property-based testing "evidence of correctness, not a proof". Use it inside one function; check what users see end to end.
Best check
Why
For any quantity from 1 to 99, the line total equals price times quantity
Property test
Pure arithmetic over a range; random inputs find edge cases
WHEN SAVE10 is applied, the cart page shows the new total
End-to-end
Depends on UI, API and session state together
IF payment is declined, THEN the order is not created and the user sees 'Payment declined'
End-to-end
Crosses services; the visible message is the oracle
Best check
For any quantity from 1 to 99, the line total equals price times quantity
Property test
WHEN SAVE10 is applied, the cart page shows the new total
End-to-end
IF payment is declined, THEN the order is not created and the user sees 'Payment declined'
End-to-end
Why
For any quantity from 1 to 99, the line total equals price times quantity
Pure arithmetic over a range; random inputs find edge cases
WHEN SAVE10 is applied, the cart page shows the new total
Depends on UI, API and session state together
IF payment is declined, THEN the order is not created and the user sees 'Payment declined'
Crosses services; the visible message is the oracle
When Is Spec-Driven Testing the Wrong Tool?
It checks that the build matches written criteria. When the question is "is this good?", one of these fits better.
UX Quality
"Feels clunky" is real feedback with no oracle. Run usability sessions for it.
Wrong Specs
If the spec is wrong, the test verifies the wrong behaviour. Review the criteria with product first.
Load and Performance
A response-time criterion can be checked once; sustained load needs a load-testing tool.
AI Output Quality
It checks app behaviour and does not replace evals for what a model writes.
Visual Regressions
Specs rarely name every pixel, so catch unplanned layout changes with visual regression testing.
Some Love from our Customers
Excited to Share My Learning Journey with Kane AI & Lambda Tool!
I'm pleased to announce that I've recently gained hands-on experience exploring Kane AI through the Lambda Tool and it’s been a fantastic journey of upskilling!
KaneAI

Suryateja Goud
suryateja-goud
Attended an onboarding call for KaneAI by TestMu AI.
KaneAI is the world's first end-to-end software testing agent.
KaneAI

Anmol Baranwal
anmol-baranwal
I just discovered KaneAI by TestMu AI, and it's a game-changer! Let me walk you through how it's transforming my testing workflow
KaneAI

Muhammad Noorani
muhammadnoorani
FAQs About Spec-Driven Testing
TestMu AI for Enterprise
Get access to solutions built on enterprise-grade
security, privacy, & compliance
- Advanced access controls
- Advanced data retention rules
- Advanced Local Testing
- Premium Support options
- Early access to beta features
- Private Slack Channel
- Unlimited Manual Accessibility DevTools Tests
