6–9 Jul 2026
Europe/Warsaw timezone

roxyreqs: Adding roxygen2-style documentation to testthat

7 Jul 2026, 11:50
5m
Lightning Talk (5 minutes) Lightning Talks

Speaker

Moritz Lang (Roche)

Description

R has excellent tooling for documenting functions via roxygen2, but no equivalent for test cases. Who wrote a test? Who reviewed it? What requirement does it verify? This information often lives in comments or external documents - disconnected from the code.

The roxyreqs package extends roxygen2 to support @meta tags above test_that() blocks:

#' @meta author Alice
#' @meta reviewer Bob
#' @meta review_date 2025-01-15
#' @meta description Validates input parsing
test_that("parse_input handles edge cases", { ... })

A custom JUnit reporter exports this metadata for automated reporting, similar to pytest for Python. Validation functions ensure all tests contain required tags. This is a first step toward generating validation documentation directly from code.

This approach is especially useful in regulated industries, such as pharma and finance, where traceability between requirements and tests is mandatory. But any team benefits from clearer test ownership and structured metadata for reporting.

The package also supports @meta tags for function documentation, enabling requirement IDs for traceability and risk classifications for compliance assessments.

roxyreqs is currently used internally but will be released as open source - we welcome feedback from the R community.

If you used AI tools or services to support the preparation of this submission, please state the name and reason for using each of them.

Claude Code: Spell Check.

Keywords: Please list up to 5 keywords to help us find the right session for your contribution. roxygen2, testthat, test documentation, validation
Virtual Option This submission is for onsite presentation only
Video Recording Video sharing is fine
The author(s) agree(s) to take responsibility and be accountable for the contents of the submission and is/are authorized to present it. Confirm

Author

Co-authors

Mario Annau (Roche) Doug Kelkhoff (Domino Data Lab) Szymon Maksymiuk (Roche)

Presentation materials

There are no materials yet.