AI Help
How do I get an AI coding agent to add a regression test for an existing bug?
Ask for a test that demonstrates the bug through the normal interface and passes after the fix. Review its assertions against the intended behavior.
Steps to follow
- Describe the observable failure and the expected result using a small real-world example.
- Require the test to fail on the original code for the relevant reason, then implement the fix.
- Run the new test and related existing checks. Avoid assertions that merely repeat the implementation's internal steps.
Example in practice
Illustrative example. A retry bug test submits the same event twice and checks that only one destination record exists.
Related AI help
- How do I give an AI coding agent a failing test to reproduce a software bug?
- Why does an AI-generated patch pass locally but fail in CI?