Code RoomVerify behavior-preserving refactor
HardPrep Room Coding #4185

Verify behavior-preserving refactor

Vibe & agenticCode quality & reviewSenior–Staff~22 min

An AI agent did a sweeping refactor: it replaced a hand-rolled `formatMoney(cents, currency)` helper with calls to a new `Money` value object across ~120 call sites in a Java billing codebase, claiming "behavior-preserving." The unit tests for `Money` pass. How do you verify the refactor actually preserved behavior at all 120 sites, given you can't read each one carefully, and what's the specific risk you're hunting for?

Implement
format_money(amount_minor: int, currency: str) → str
Examples
in[1234,"USD"]out"USD 12.34"
in[1234,"JPY"]out"JPY 1234"
in[1234,"KWD"]out"KWD 1.234"
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.

0:00 of about 22 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.