

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Feedback Loops
incomplete
2: Static Typing
incomplete
3: Automatic Formatting
incomplete
4: Tests
incomplete
5: AI and Test Economics
incomplete
This lesson's interactive features are locked, please to keep using them
Writing tests with AI is way cheaper than writing them by hand, which changes the ol' "How many tests are enough tests" debate in an interesting way.
These days, you can be more aggressive about adding targeted tests because the cost of writing them has come down. But "cheap to write" does not mean "generate 1,000 brittle, low-quality tests."
Good tests communicate expected behavior. You still don't want redundant, brittle, or meaningless tests just because someone told you 100% test coverage is a "best practice."
That said, if there's undertested code that's been running correctly and deserves to be covered by tests, it's great to get the agent to help you increase the test coverage.
I've had people ask me:
"My agent makes a lot of new tests for each change. Should I commit them all? Or let the agent discard them after it ensures the code works?"
Some developers assume that all correct tests are keepers. But I actually have a higher standard:
I do this because I don't want thousands of tests for specific behavior that happens to be correct now, but that will likely get respecified later. For example: