{
  "id": 9840785,
  "title": "MC/DC coverage for JavaScript",
  "url": "https://urgent.news/2026/09/25/mc-dc-coverage-for-javascript",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-25T21:19:25.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/nedomas/mcdc-coverage-for-javascript-4388"
  },
  "original_language": "en",
  "account": "JavaScript code coverage tools can measure Modified Condition/Decision Coverage (MC/DC), which ensures each condition independently affects the decision outcome. In this example, a checkout function's condition is signedIn && !expired. To achieve MC/DC, tests must demonstrate that changing one condition independently alters the decision's result. The original tests cover valid sessions and signed-out users but miss the case where a signed-in customer has an expired session. To address this gap, a new test is added to check the checkout denial for a signed-in customer with an expired session. After adding this test, MC/DC coverage improves to 50%, indicating the condition now independently affects the decision outcome.",
  "summary": "A checkout function can have 100% line and branch coverage without a test for an expired session. Both return paths run. Both tests pass. But removing the expiry check still leaves the suite green. MC/DC coverage asks a more specific question: has each condition been shown to change the decision on its own? Here's what that looks like in JavaScript, using a small example we ran with Supercov. The…",
  "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."
}