Testing Workflow
Automated tests give coding agents feedback before humans do. This is one of the things that makes agents more autonomous and therefore more useful for completing larger coding tasks.
The problem: agents are "lazy"
We've all seen coding agents:
- forgetting to run some tests
- not writing tests for new functionality
- declaring the job done while tests are still failing
CodeSpeak runs agents under the hood and enforces discipline about tests.
How the commands work together
CodeSpeak gives you four commands with increasing levels of test enforcement:
| Command | What it does | When to use |
|---|---|---|
codespeak impl | Implement the spec, no dedicated test phase | Quick-and-dirty iteration โ you'll test manually |
codespeak build | Implement + enforce tests pass | Production-quality builds |
codespeak test | Run tests, fix failures iteratively | After impl, or when you want to make sure existing tests pass |
codespeak coverage | Run tests with coverage, add missing tests | When you want to invest in a better test suite |
A typical workflow:
- Write or edit your spec
- Run
codespeak implfor fast iteration - When the implementation looks right, run
codespeak testto make sure all tests pass - Run
codespeak coverage --target 100 --max-iterations 5to fill in missing tests - From now on, use
codespeak buildto enforce tests on every change
Auto-configuring the test runner
CodeSpeak needs to know how to run tests in your project. On your first build, you'll see:
A placeholder test runner configuration was added to codespeak.json for spec 'spec.cs.md'.
Please fill it in with actual values, or run 'codespeak test --auto-configure --spec spec.cs.md' to auto-detect it.
Built successfully.
Let CodeSpeak discover the test runner automatically:
codespeak test --auto-configure --spec spec.cs.mdAuto-configured test runner for spec 'spec.cs.md'
From now on, codespeak build will automatically run tests after implementation. If tests fail, CodeSpeak will attempt to fix them before reporting success.
See also
codespeak buildโ full build with test enforcementcodespeak implโ quick implementation without test enforcementcodespeak testโ run and fix testscodespeak coverageโ improve test coverage- Improve Test Coverage tutorial โ step-by-step walkthrough