Why Passing Tests Doesn’t Always Mean AI Fixed the Bug
Working with AI coding agents, I've seen situations where an agent reports a successful fix, all tests pass, but the original problem is still there. Sometimes, instead of fixing the root cause, the agent adds a workaround, weakens…

Working with AI coding agents, I've seen situations where an agent reports a successful fix, all tests pass, but the original problem is still there.
Sometimes, instead of fixing the root cause, the agent adds a workaround, weakens a check, or modifies a test just to make it pass.
I recently came across ub-mode, an open-source skill by Robert C. Martin, the author of Clean Code. It provides a set of engineering rules for AI agents when writing or modifying code.
What Rules Does ub-mode Introduce?
A few principles stood out to me:
- Fix root causes, not symptoms. If a change only hides the error, it's not a real fix.
- Reproduce the problem first. Before changing code, write a test that exposes the bug and confirm it fails for the expected reason.
- Test behavior, not implementation. If a test still passes when functions stop returning meaningful results, the test isn't useful.
- Keep changes minimal. Fix the problem without introducing unnecessary complexity.
- Verify test quality. Use coverage analysis, complexity metrics, and mutation testing when the required tools are available.
The last point is particularly interesting. High test coverage doesn't necessarily mean your tests can catch real bugs.
How to Try It
The skill is available in the GitHub repository.
For Claude Code, copy SKILL.md into:
~/.claude/skills/ub-mode/SKILL.md
Then activate it with:
/ub-mode
The project also uses separate tools for additional quality checks: crapper, dryer, and mutator.
Why I Find This Important
I like this approach because the biggest challenge with AI-assisted development isn't always how quickly code gets written. It's knowing whether the result is actually correct.
An agent can make changes quickly and report passing tests. But without reproducing the bug and verifying the behavior, it's difficult to know whether the issue was really fixed.
Of course, installing a skill doesn't guarantee quality. Its rules still need to fit the project, and the results should be independently verified.
For me, a task isn't complete just because an AI agent reports success. It's complete when the root cause is fixed and the result is backed by meaningful tests.




