{
  "id": 8617272,
  "title": "The Bug That Passed Every Test and Still Lost Me Money",
  "url": "https://urgent.news/2026/09/20/the-bug-that-passed-every-test-and-still-lost-me-money",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-20T04:46:31.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/botandbull/the-bug-that-passed-every-test-and-still-lost-me-money-1gl5"
  },
  "original_language": "en",
  "account": "A stock trading bot was built and put through rigorous testing, but a bug slipped through that lost the bot money. The bot was programmed to run a routine at the end of the trading day, but the tests used fixed timestamps instead of the real world scenario. The server ran on UTC while the market runs on Eastern time, causing the bot to make decisions based on incomplete data. The tests proved the code was consistent but not correct, as they didn't account for external factors like time zones, holidays, and missing data. To fix the issue, the bot's tests now use realistic data with proper timezone awareness. The author emphasizes that a green test suite only indicates that the code is consistent, not correct, and stresses the importance of testing the environment, not just the function, especially when dealing with real-world transactions.",
  "summary": "I am building an automated stock trading bot in public. I am not a developer by trade, so I lean hard on tests to feel safe shipping. Which is exactly why this one stung: a bug that passed every single test I had, and still lost me money the moment it touched the real market. The suite was green, so I trusted it Every test passed. I deployed. That green checkmark felt like permission. The problem…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}