Verify Tests Fail Before Trusting ThemVerify Tests Fail Before Trusting Them
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
94 tests passed. The feature did nothing. The check was reading its own log entry, so it passed no matter what the code did. Since then, I don't trust a test until I've watched it fail: 1. Remove the thing the test guards 2. Run it: it should fail 3. Put it back: it should pass If step 2 passes, the test is useless. Across ~1,900 tests on a production platform, this is the habit my client valued most. Do you check that your tests can fail?
Post image
Shoaib's avatar
This matters even more when AI writes the tests, because it will happily write a check that agrees with the code. I now ask for a deliberate break first and only trust a test once it goes red.
Samuel's avatar
Exactly. AI-written tests are the worst offenders, because they're written to agree with the code they're checking. Asking for the deliberate break first is a great rule. Do you make the AI break the code itself, or do you break it by hand and let the AI fix the test?
Shoaib's avatar
I break it by hand, usually by deleting the one line the test guards. When the AI does the breaking, it tends to pick a break its own test already catches.
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started