AI-Written Code and Tests: The Shared Blind Spots Trap
You ask your AI coding agent to implement a FastAPI endpoint, then ask it to write the unit tests. pytest turns green. pytest --cov reports 100% line coverage. The diff looks clean, the assertions are readable, and the PR is ready to merge. Three days later, a client sends a slightly malformed payload and your endpoint returns a 500 error or silently applies a negative discount. This is not a freak incident. With AI-written tests generated in the same session as the implementation, both artifacts share the exact same implicit assumptions. The tests do not prove that the code survives reality: they only prove that the code matches what the model had in mind when it wrote it. ...
