Skip to content

Light contract-style data test template (conditional on observed drift) #38

Description

@larnsce

Milestone: v1.3.0 (attach once the milestone exists). Depends on #37. Conditional: only start if v1.1/v1.2 experience shows post-review drift in published packages (data updates silently breaking floor guarantees). Part of the v1.1 roadmap: docs/roadmap-v1.1.md.

Tasks

  • Template tests/testthat/test-data.R asserting only stable contracts: data loads, non-empty, every column present in data-raw/dictionary.csv and vice versa. The tests read the dictionary at runtime, never interpolate literals.
  • Explicitly banned assertion styles, from premortem finding F2 (snapshot tests become red-CI landmines on the first legitimate data update, and students respond with skip()): no dim() literals, no frozen date ceilings, no level-set equality.
  • Data-update playbook (edit the dictionary first, rerun the tests) shipped in the package-resident standards file so future sessions in reviewed packages see it.

Acceptance criteria

A simulated data update (new rows, new category value) passes the template tests unchanged; a removed or renamed column fails them.

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions