Deep into Ruby Code Coverage
summary
DeepCover adds node coverage and stricter branch coverage to Ruby tests by parsing source with the parser gem, rewriting code to insert runtime trackers, and emitting HTML reports. It finds real gaps: ActiveSupport loses edge-case tests, some projects drop from 100% to ~96% node or to ~77% branch coverage, and a compact codebase yields three confirmed bugs. It runs slower than MRI’s builtin coverage but integrates on CI via require/load rewriting, iseq_load, or offline rewriting.
AI-written summary · about
chapters (16)
- 0:00Introduction and speaker intro
- 0:49What is code coverage?
- 3:15Method vs line vs node coverage
- 7:10Branch coverage explained
- 8:34Why code coverage matters
- 9:21Introducing Deep Cover
- 10:46Deep Cover demo and report
- 13:43Real-world examples from Active Support
- 15:51Deep Cover vs MRI coverage
- 17:17Deep Cover takeover of built-in coverage
- 19:04How code coverage works under the hood
- 27:09Implementing Deep Cover in Ruby
- 31:26Control flow interruption cases
- 36:26Future of Deep Cover and reporting
- 37:52Acknowledgments and thanks
- 38:13Q&A session
related talks
43mAn introduction and future of Ruby coverage library
26mImproving Coverage Analysis
23mDigging Up Code Graves in Ruby
25mRethinking JavaScript Test Coverage
28mEnough Coverage To Beat The Band
35mRisk Based Code Coverage Analysis
46mCode coverage MythBusters
52mCross-Platform Unit Testing and Code Coverage with Coverlet
