Skip to content

Retrofit claim assertions into the existing vignettes (vignettes are integration tests) #62

Open

Description

@DougManuel

Principle

MockData's vignettes run the package's own code on realistic metadata, and R CMD check rebuilds every one of them in CI. That makes them integration tests, but only if a vignette fails when the code stops doing what its prose says. CONTRIBUTING.md now states the rule and the pattern (added in #61): compute every factual claim with inline R, and guard the claims with a hidden chunk of named stopifnot() conditions, so a regression fails the render with a message naming the broken claim.

Current state (2026-09-26)

The three survival vignettes follow the pattern (17 assertions between them), and a mutation check in #61 showed they catch regressions: flipping the censoring comparison failed two of them, and making it non-strict failed the third. The other 14 vignettes carry 2 assertions in total (tutorial-dates):

Vignette Code chunks Inline values Assertions
tutorial-garbage-data 18 31 0
tutorial-missing-data 11 19 0
tutorial-dates 14 15 2
reference-config 4 13 0
tutorial-categorical-continuous 17 8 0
migrating-from-v03-v04 16 0 0
diagnostics-and-garbage-v04 15 0 0
recodeflow-metadata-v04, choosing-a-backend-v04, getting-started, getting-started-v04, for-recodeflow-users, advanced-topics, design-philosophy-v04 8 to 13 each 0 0

The tutorials with many inline values are the quickest wins: the claims are already computed, and only the checks are missing. The how-to and explanation articles with no inline values need their prose claims identified first.

Done when

Relates to #61.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Nice to have, lower urgencydocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions