# Statement vs branch coverage, with decision, line and path coverage > Statement vs branch coverage on one function in Jest, coverage.py and Go: 100% statements with half the branches, decision and path coverage, and MC/DC. Web page: https://supercov.com/blog/statement-vs-branch-coverage · Published 2026-11-27 All Supercov pages for agents: https://supercov.com/llms.txt · Full text: https://supercov.com/llms-full.txt One function, four test sets, three tools: what statement, line, branch, path and MC/DC coverage each report. Statement coverage counts the statements your tests ran. Branch coverage counts the outcomes of each decision: both the true and the false side of every `if`. One test can run every statement and still skip half the branches. In coverage tools, decision coverage means the same as branch coverage. Path coverage counts whole routes through a function, and none of the tools we measured reports it. ![A control flow diagram of price(6000, true, true): total = cents, then if member and cents at least 5000, true to total minus 500, then if coupon, true to total halved, then return. Every statement ran. Both false edges, drawn dashed in red, were never taken.](https://supercov.com/assets/statement-vs-branch-coverage-flow-1360.f0ff2f2eb1.webp) *One test runs every statement and skips both false branches.* ## The kinds at a glance | Kind | Counts | Reported by | | --- | --- | --- | | Line | Lines with code that ran | Istanbul, V8, JaCoCo, coverage.py | | Statement | Statements that ran; a line can hold several | Istanbul, V8, coverage.py, `go test -cover` | | Branch (decision) | Each outcome of each `if`, `?:`, `&&`, `switch` | Istanbul, V8, JaCoCo, coverage.py `--branch` | | Condition / MC/DC | Each condition inside a decision, shown to matter | Supercov | | Path | Every route through the function | None of the tools we measured | We measured one function with Jest 30.5.2, coverage.py 7.17.2 and Go 1.27.4, then with Supercov 4.28.0: ```js function price(cents, member, coupon) { let total = cents; if (member && cents >= 5000) total = total - 500; if (coupon) { total = total / 2; } return total; } ``` ## One test: every statement, half the branches ```js price(6000, true, true); ``` | Tool | Statements | Branches | | --- | --- | --- | | Jest (Istanbul) | 7/7 | 4/6 | | coverage.py | 6/6 | 1/2 with `--branch` | | `go test -cover` | 100% | Not reported | Every statement ran, so statement and line coverage read 100%. Neither `if` was ever false. Jest counts six branches: two outcomes for each `if`, plus the two sides of `&&`. `go test -cover` reports statements only, so the missing outcomes do not show at all. coverage.py counted 2 branches, not 4, because the first `if` and its body share a line, and it tracks branches as jumps between lines. Written over two lines, the same test showed 4 branches with 2 partial, and the report listed the missing jumps `3->5, 5->7`. ![A grid of four test sets against statements, branches, paths and MC/DC. One test: statements only, branches 4 of 6. Two tests: statements and branches, paths 2 of 4. Three tests: statements, branches and MC/DC, paths 3 of 4. Four tests: statements, branches and paths, with an MC/DC gap still left.](https://supercov.com/assets/statement-vs-branch-coverage-grid-1360.ec88336dad.webp) *What each test set completed: every path still left one condition untested.* ## Two tests: 100% branches, half the paths ```js price(6000, true, true); price(1000, false, false); ``` Branch coverage reached 6/6 in Jest and 100% in coverage.py: each `if` went both ways. The function has four paths, member discount with or without the coupon, and no discount with or without it. These two tests ran two of them. Reaching all four took four tests, and no tool's numbers changed on the way: path coverage is not something they count. ## Decision vs condition coverage At 100% branch coverage, `cents >= 5000` had never been false. The second test set `member` to false, so `&&` stopped before reaching `cents`. Jest's `&&` branch counts whether each side ran, not whether it was ever false, so it still read 6/6. ``` LINE STATUS SOURCE 3 PARTIAL member && cents >= 5000 Unobserved: `cents >= 5000` was never false; needs `member` true, `cents >= 5000` false, decision false ``` Supercov reported this as an MC/DC gap. Adding `price(1000, true, false)` closed it with three tests. The four tests that ran every path did not: none of them had a member with a small order, so the gap was still there. See [MC/DC vs branch coverage](https://supercov.com/compare/mcdc-vs-branch-coverage.md) for how the two differ on larger decisions. ## Which to use Statement or line coverage tells you what never ran. Branch coverage tells you which decisions only ever went one way, and is the usual number to put a floor on. Condition and MC/DC coverage tell you which part of a compound condition no test changed. Path coverage doubles with every `if` in sequence, which is why the tools leave it out, and as the four tests above showed, every path still does not mean every condition. ## What Supercov adds ```sh npx supercov -- npm test npx supercov runs latest file src/price.js ``` Supercov reports lines, statements, branches and MC/DC in one run, and names the test that covered each line. See [Line, statement and branch coverage](https://supercov.com/compare/line-vs-branch-coverage.md) for how each tool counts lines.