Testing & TDD
Do not stop at code that looks right.
Turn expected behaviour into a check. Generate tests in your project context or start with a failing test and work through implementation and refactoring.
AI test generation is available from Pro. An existing, runnable project test setup is needed to execute and verify the tests.
Behaviour before implementation
Follow the TDD cycle
-
RED
Define what should happen.
Write a failing test for the required behaviour and check that it fails for the right reason.
-
GREEN
Make the smallest change.
Implement enough to satisfy the test. Run it again to verify the behaviour.
-
REFACTOR
Improve it without changing it.
Clean up the implementation and rerun the relevant tests to catch regressions.
Tests for the code you have
Start with the implementation. Add the missing checks.
/test gen reads a file or module and the test setup, then asks the agent to generate tests for normal cases, boundaries and errors. Review what the assertions actually prove.
- Generate tests for a source file
/test gen src/auth.ts
- Read the code and its dependencies
- Match the project test framework
- Create assertions and required mocks
- Run tests and investigate failures
Keep test-first work intentional
A guard for the workflow.
TDD Guard can warn about source changes without corresponding tests or apply stricter blocking. Choose the setting for your task; it does not replace a review of test quality.
- Enable warnings
/tdd on - Enable strict mode
/tdd strict - Disable TDD Guard
/tdd off
Before the next handoff
A green run needs meaningful assertions.
Run the test suite your project actually uses. Check whether the tests cover the requirement, not just the implementation. Keep integration checks and human review for the paths that matter.
Generated tests can be incomplete, incorrect or overly tied to the code. Passing tests do not guarantee a bug-free or secure release.
Choose the first check.
Run these slash commands inside Lurus Code chat. Replace the example file or task with your own project context.
Read the documentation- Generate tests for a source file
/test gen src/auth.ts - Start a test-first feature
/tdd Add input validation
Your code stays yours.
Source code and request context are processed with Zero Data Retention. No use for model training. Providers and processing regions are disclosed transparently.
See privacy and processing detailsA few things to know before you start.
How do I generate tests?
Does this replace manual testing?
Can I work test-first?
Testing & TDD
Give the next change a check that matters.
Start with one file or one expected behaviour. Review the tests and run them before trusting the result.
For Pro, Pro+ and Ultra. Paid subscription after the trial unless you cancel beforehand. Usage and features depend on your plan and credit.
Want to start with your team? Talk to us.