A Ruby gem for collecting and reporting production code coverage, tracking line-of-code execution frequency.
Coverband is a Ruby gem that collects and reports production code coverage by tracking how many times each line of code is executed in a live environment. It helps developers understand which parts of their application are actually used by real users, identify dead or rarely used code, and optimize performance based on actual runtime behavior.
Ruby developers and teams running Rails, Sinatra, or other Ruby applications in production who want to monitor code usage, identify dead code, and optimize their codebase based on real-world usage patterns.
Coverband provides unique insights into production runtime behavior that test coverage tools cannot offer, with low performance overhead and easy integration. Its ability to separate eager-loading from runtime coverage, combined with features like dead method detection and an AI-ready MCP server, makes it a powerful tool for maintaining and optimizing production applications.
Ruby production code coverage collection and reporting (line of code usage)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Designed with minimal impact on production, using background reporting threads to avoid blocking requests, as highlighted in the key features.
Separates coverage for code loaded during boot versus actual runtime execution, providing clear data on what users execute, detailed in the web UI columns.
Includes a mountable rack app for viewing and sharing coverage reports with drill-down capabilities, making team collaboration easy.
Offers a rake task to identify methods never called based on coverage data, directly aiding in code cleanup efforts.
Optional MCP server allows AI assistants like Claude to query coverage data, enabling advanced analysis and dead code detection.
Requires a Redis instance for production, and high-volume sites may face race conditions or need dedicated resources, as discussed in the Redis Sizing Info section.
Incompatible with bootsnap and has issues with APM tools like Scout APM or Elastic APM, requiring manual fixes or gem ordering.
Admits to being 'total fail' for line-level coverage of ERB and similar templates, with line numbers often off, necessitating filtering via ignore config.
May require manual hooks or environment variable management, especially when other gems alter Rails initialization, as seen in the 'Fixing Coverage Only Shows Loading Hits' section.