Code Room
Vibe codingHardvc-g159
Subject Ai test reviewLevel Senior–Staff~18 minCommon in Security interviewsIndustries Software development

Question

An AI agent wrote a function that builds a shell command and an accompanying Bash/Python test. The function interpolates a user-supplied filename into a tar command. The agent's test:

python
def test_archive_file():    cmd = build_tar_cmd("report.csv")    assert cmd == "tar -czf out.tgz report.csv"    # and it runs:    assert run(build_tar_cmd("report.csv")) == 0

The test passes and 'verifies archiving works.' Why does this test give dangerous false confidence, and what tests would actually protect you?

What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it — tests, edge cases, reading critically — and how you’d re-prompt or decompose to get it right.

Describe your solution

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.