How to write tests in the AI era: 6 rules to stop mock-riddled brittle tests

dotey · x · 2026-09-15

In the vibe coding era, unguided AI writes brittle, mock-heavy tests that verify implementation rather than behavior. The author's thesis: quality is designed in, not tested in. His six rules: test behavior not implementation, use BDD with Given/When/Then, ban mocks (use real services or contract-checked fakes and fake timers), prefer E2E with tiered runs, treat coverage as a follow-up question (target 90% and interrogate uncovered failure paths), and encode rules as lints.

Original post →

More from coding & agent

coding & agent channel →