← Back to all sparks
T

testdat

INFRA · APIS
Velocity0.0

Unit testing for datasets, built on testthat and now bending to its next release.

data-validationunit-testingtestthattidyselectdata-quality
Current state
testdat applies the testthat idiom to data rather than code: expectations that assert properties of a data frame, run as a suite, with results exportable to Excel. Recent releases have been about correctness and upstream compatibility. Expectations are now constructed via new_expectation() ahead of testthat 3.3.0, and expect_base() errors on a missing variable instead of silently passing.
Where it's heading
The package reached its shape early and has spent the years since sanding it. The design decisions worth noting are all in the past: the move to tidyselect at 0.3.0, the test data pipe at 0.4.0, and the failure messages at 0.4.1 that name which variable failed rather than just reporting a count. Since then activity is sparse and reactive, tracking testthat and R-devel. The two 0.4.3 and 0.4.4 tags arriving ninety minutes apart on the same day is the signature of a release caught by an upstream deadline.
Prediction
The immediate work is finishing the testthat 3.3.0 adaptation. Beyond that the notes give no evidence of new expectation families; the package looks maintained rather than developed.

Recent moves

  1. 9mo ago

    Expectations rebuilt on new_expectation() for testthat 3.3.0

    A compatibility change contributed upstream, moving expectation construction onto new_expectation() ahead of testthat 3.3.0. Nothing user-facing changes; it is the cost of building a package on someone else's testing framework.

    View source ↗
  2. 9mo ago

    expect_base() errors on a missing variable instead of passing

    A one-line note describing a real trap: testing a variable that does not exist used to pass. In a data validation suite a silent pass is worse than a failure, because it reports coverage that was never there.

    View source ↗
  3. 2y ago

    Grouped data frames ungrouped before testing

    Groups are now stripped from grouped data frames retrieved by get_testdata(), since grouping breaks several expectations, plus a fix for an upcoming R-devel change. Defensive maintenance.

    View source ↗
  4. 3y ago

    Failure messages name the failing variable; expect_depends() added

    The most user-visible release in the feed. Failure messages now identify which of several tested variables failed rather than reporting an aggregate count, which is the difference between a usable and a frustrating suite when checking many columns at once. expect_depends() adds functional dependency testing, and expect_allany() is soft deprecated as the shared back end no longer fits.

    View source ↗
  5. 4y ago

    Test data pipe lets expectations sit inline in a chain

    The %E>% pipe lets expectations be placed directly in a data manipulation chain rather than wrapped in with_testdata() calls. Syntactic, but it changes where checks live: inline with the transformation they guard rather than collected elsewhere.

    View source ↗
  6. 4y ago

    CRAN release moves variable selection to tidyselect

    ⚡ SPARK

    The release that put testdat on CRAN and, in the same breath, broke every existing variable selection. Adopting tidyselect aligned the package with the rest of the tidyverse and collapsed the distinction between single and multi-variable expectations.

    View source ↗