Write THREE functions. 1) diagnose(testName) — map failing test names to causes: names containing "empty" -> "edge-case", containing "slow" -> "performance", containing "null" or "undefined" -> "type-error", otherwise "logic". 2) analyzeSpy(spy, expectedCount, expectedFirstArg) — spy is { calls: [[arg...], ...] }; return true only when calls.length === expectedCount AND calls[0][0] === expectedFirstArg, else false (handle zero calls safely). 3) fixAndProve(isFixed, testPasses) — a fix counts only when BOTH the underlying behavior is fixed AND the regression test passes: return "fixed" when both true, "untested" when fixed but test fails, "broken" otherwise.
Difficulty: intermediate