Question
You inherit a legacy billing utility and ask an AI agent to explain this JavaScript function. The agent confidently replies: "This computes the number of full billing days between two dates inclusive of both endpoints — so Jan 1 to Jan 3 returns 3." Before you build a proration feature on top of it, how do you check whether that explanation is actually true?
function billingDays(start, end) { const ms = end.getTime() - start.getTime(); return Math.floor(ms / 86400000);}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.
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.