From Bug Report to a Failing Test in the Terminal
From Bug Report to a Failing Test in the Terminal
The report says: “The March dashboard includes an invoice from February.” There is a screenshot, an account identifier, and no reproduction steps. My first temptation is to paste everything into a coding assistant and ask for a fix. That is also a reliable way to get a plausible patch for the wrong bug.
Here is a worked comparison using a TypeScript application and Vitest. Both approaches start with the same report. The difference is whether we ask the assistant to explain the symptom or make it fail deterministically.
The shared fixture: March in Los Angeles
First, translate the report into a contract. The dashboard groups invoices by the account’s timezone, not the server’s timezone. Our example account uses America/Los_Angeles. An invoice timestamped 2026-03-01T00:30:00Z belongs to February there, even though its UTC date says March.
Use synthetic records rather than copying customer data. Set the requested month explicitly to March 2026. If the production entry point derives that month from the clock, freeze time at 2026-03-01T12:00:00Z instead. Do not silently change the public interface just to make testing convenient.
Side-by-side: asking for a fix or a reproduction
- The fix-first prompt says: “Investigate this report and fix the dashboard’s month filtering.”
- The reproduction-first prompt says: “Trace the month filter, then add one failing regression test without changing production code.”
The first prompt leaves several decisions implicit. The assistant might assume the browser timezone is authoritative, change formatting instead of filtering, or write a test around its proposed implementation. A green result would not establish that it reproduced the original symptom.
The second prompt creates a reviewable stopping point. Add these constraints: use the account timezone, reuse the existing test framework, avoid network access, and show the exact command plus the failing assertion. Ask the assistant to flag missing product rules rather than invent them.
Side-by-side: a broad patch or two decisive invoices
- The fix-first path can spread across date helpers, rendering components, and snapshots before the expected behavior is settled.
- The reproduction-first path starts with two invoices and asserts their exact identifiers through the real filtering entry point.
The first invoice is dated 2026-03-01T00:30:00Z and must be excluded from March. The second is dated 2026-03-01T08:30:00Z and must be included. Give them distinct identifiers, such as february-local and march-local. Assert that the result contains exactly march-local, not merely that its length equals one.
This catches both the boundary mistake and an overcorrection that drops every invoice. Keep the actual date conversion code in the execution path. Mocking the month-filter helper would replace the behavior we need to investigate.
The terminal evidence that makes the test credible
Run npx vitest run tests/invoice-month.test.ts before touching production code. The useful failure is an assertion showing february-local unexpectedly present. A missing import, unavailable database, or invalid fixture is not a reproduced bug.
Then permit the smallest production change and rerun the same command. After it passes, temporarily revert only that change and confirm the assertion fails again. Restore the fix and run the relevant broader suite. This red-green-red check is stronger evidence than an assistant’s summary.
Inspect the diff yourself. Check for timezone defaults, hardcoded month offsets, unrelated lockfile edits, and assertions weakened during the fix. March’s daylight-saving transition also makes a separate end-of-month boundary test worth adding afterward.
Keeping the assistant interchangeable through Fluxo
Fluxo fits this editor-and-terminal loop with one key and one base URL, https://api.fluxorelay.com, for Claude, GPT, Gemini, DeepSeek, Kimi, GLM, Qwen, Grok, and more. It works with Claude Code, Codex, Gemini CLI, and any OpenAI SDK. For a second review, Claude Sonnet 5.5 and GPT-6.1 Sol are concrete options; keep the fixture and acceptance criteria unchanged.
Billing follows real tokens, including cache reads and writes, with no monthly fee. Users also earn a referral share when people they invite pay. If this workflow suits your setup, consider creating a Fluxo account.
Verdict: the failing test beats the convincing patch
Choose reproduction-first for ambiguous bug reports. Fix-first is shorter to request, but reproduction-first produces something independently checkable: a deterministic failure, a narrow patch, and a regression guard. The assistant proposes the work; the terminal supplies the evidence.