EPATADA icon indicating copy to clipboard operation
EPATADA copied to clipboard

TADA function template?

Open ehinman opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I was thinking about our conversation about regression testing yesterday, and the basic questions of: what happens when someone inputs an empty dataset or a vector into the function, a dataset missing required column names, etc. etc. and it made me wonder if the TADA package should have a template for writing new functions. The template could have example roxygen2 notation, as well as the basic function QC lines needed to ensure the function can run -- I'm thinking like the TADA_CheckType(), TADA_CheckColumns(), match.arg(), check data format, etc. Are there more of these checks that should be added to the start of EVERY function? Another one I do a lot is a dimension check before/after a data wrangling step: should the dataframe be able to grow/shrink in rows? How does this growth/reduction happen (e.g. duplication of results or creation of new results)? This could be broken down in a small vignette to help contributors.

There could additionally be a testing template as well. What tests apply to all functions, versus which tests are specific to the type of function/output?

ehinman avatar Aug 24 '23 14:08 ehinman

Note: work on with https://github.com/USEPA/TADA/issues/397 (create new function to check that df does not grow/shrink & add to range check flag function)

cristinamullin avatar Feb 12 '24 20:02 cristinamullin