Ruby · Comparison
Ruby coverage: SimpleCov vs Supercov
Compare SimpleCov and Supercov for Ruby line, branch, per-test, MC/DC, and assertion coverage, with a concrete missing-test example.
What is the difference?
SimpleCov measures Ruby coverage and helps you inspect unexecuted code. Supercov also measures independent conditions and connects executed source to the assertions your tests make.
SimpleCov is not limited to a single line percentage. Version 1.3 supports branch coverage and per-test tracking. If those already answer your questions, you do not need to change tools just to use a coding agent.
| Feature | SimpleCov1.3.0 | Supercov0.0.47 |
|---|---|---|
| Line coverage | Supported | Supported |
| Branch coverage | Supported | Supported |
| MC/DC | Not built in | Supported |
| Per-test coverage | Supported | Supported |
| Assertion coverage | Not built in | Supported |
✓ Supported · × Not built in. Standard coverage workflows in the versions shown; custom plugins are outside this table.
Supercov supports MRI Ruby: full MC/DC on 3.4+, limited measurement on 3.3. SimpleCov 1.3 requires Ruby 3.3+.
SimpleCov’s per-test coverage requires track_tests. Neither tool promises exact per-test coverage for overlapping threaded tests.
Per-test coverage means individual tests, not just test files. Supercov needs a supported runner. Assertion coverage links source to checked properties through agent review; it is not a mutation score or a correctness guarantee.
Start with your existing Ruby tests
Load SimpleCov before application code so it can measure the files as they load. In your test helper:
require 'simplecov'
SimpleCov.start do
enable_coverage :branch
end
# Load the application and tests after this.
To associate coverage with individual tests, enable SimpleCov’s track_tests option for your runner. See its configuration guide. Its CLI guide also covers comparing runs and finding affected tests.
A branch can run without every condition being tested
def can_access(signed_in, expired)
if signed_in && !expired
return true
end
false
end
These Minitest checks exercise both outcomes:
assert can_access(true, false)
refute can_access(false, false)
But they do not test session expiry. Add refute can_access(true, true) to check that a signed-in user loses access when the session expires.
In our Ruby fixture, SimpleCov 1.3.0 reported all four lines and both branches covered. Supercov 0.0.46 reported one of two independent conditions covered. Both results can be correct: branch coverage and MC/DC answer different questions.
When Supercov is useful
Keep your RSpec or Minitest suite. Run its complete command through Supercov, then inspect the gaps:
supercov -- bundle exec rspec
supercov runs latest gaps
You install the Ruby gem first; there is no npx step. The Ruby getting-started guide covers setup.
Assertion coverage adds another question: what did the tests actually check? Your agent reviews passing assertions and the recorded execution, then maps the source that contributes to each checked property. It can investigate an unasserted result without generating mutants. That review is not a guarantee that a test will catch every wrong result.
Choose SimpleCov for an established Ruby reporting workflow. Choose Supercov when you want your agent to investigate condition and assertion gaps as well. Full Supercov MC/DC requires MRI Ruby 3.4 or newer; exact per-test attribution should not be assumed for overlapping threaded tests.
Example evidence: fixture source and recorded results (JSON). Measured September 13, 2026. These small examples are not a performance benchmark or a general conformance test.