In plain words
Test-driven development is a loop: write a test for the next small behaviour, watch it fail, write the least code that makes it pass, then tidy up while the tests stay green.
Where you see it
Before Harbor adds annual plans, you write a test saying a year of Pro costs ten months of the monthly price. It fails, because annual plans don't exist yet. You hand the agent the red test and ask for code that turns it green without touching the test.
What goes wrong
- Skipping the red step
A test that has never failed might not test anything: it may call the wrong function or never reach its assertion. Watch it fail once, for the reason you expect, before writing the code.
- Letting the agent write the test and the code together
The agent produces code and a test that agree with each other, including on the bug. Write or approve the test first, commit it, then ask for code that passes it without editing the test.
- Steps that are too big
A test for the whole billing system takes a day to turn green, and the loop stops giving you feedback. Pick the next smallest behaviour and add one case at a time.
What to tell your agent
Quick check
Sign in to earn +10 XP for itYou write a test for annual pricing before the feature exists, and it passes on the first run. What does that tell you?