Measure and report test coverage for R, C, C++ and Fortran code in R packages

September 23, 2016 Jim Hester

Code coverage records whether or not each line of code in a package is executed by the package’s tests. While it does not check whether a given program or test executes properly it does reveal areas of the code which are untested.

Coverage has a long history in the computer science community (Miller and Maloney in Communications of the ACM, 1963), unfortunately, the R language has lacked a comprehensive and easy to use code coverage tool. The covr package was written to make it simple to measure and report test coverage for R, C, C++ and Fortran code in R packages. It has measurably improved testing for numerous packages and also serves as an informative indicator of package reliability. Covr is now used routinely by over 1000 packages on CRAN, Bioconductor and GitHub. In this webinar we’ll discuss how covr works, how it is best used and how it has demonstrably improved test coverage in R packages since its release.

Download Materials

About the Author

Jim Hester

Jim is a software engineer at RStudio working with Hadley to build better tools for data science. He is the author of a number of R packages including lintr and covr, tools to provide code linting and test coverage for R.

Follow on Twitter More Content by Jim Hester
Previous Video
Introducing Shiny Gadgets: Interactive Tools
Introducing Shiny Gadgets: Interactive Tools

A Shiny Gadget is an interactive tool that enhances your R programming experience.

Next Video
RcppParallel provides a complete toolkit for creating safe, portable, high-performance parallel algorithms
RcppParallel provides a complete toolkit for creating safe, portable, high-performance parallel algorithms

RcppParallel provides a complete toolkit for creating safe, portable, high-performance parallel algorithms

×

Please register to receive regular updates on our webinars.

!
Thank you!
Error - something went wrong!