How non-programmers can make sparks fly when using testthat during package development
summary
Package development for non-programmers is practical: using testthat plus CI catches real bugs and supports refactors. Example: tidywater’s define_water, chemdose_ph and blend_waters use tests to compare alternative workflows; devtools::test shows 33 tests for balanced_ions, 25 for biofilters and 50 tests with one failure for define_water. A refactor from tidyverse to base R introduced a merge default (inner vs left join) bug that tests find. GitHub R-CMD-check and coverage gates block merges until checks pass, enabling a safe, faster package.
AI-written summary · about
chapters (5)
- 0:00testthat for non-programmers
- 2:29Testing inputs and outputs
- 8:42Trusting edge cases
- 10:53Refactoring and automation
- 16:46Q&A
related talks
19mGetting it right: Writing reliable and maintainable R code
29mHow I Learned to Stop Worrying and Love Unit Testing
01h 01mA Test a Day Keeps Your Manager Away!
28mTiny Tools Tidy Tests
01h 03mRewiring your brain with test driven thinking in C++
37mClean Test Code
42mEffective Developer Testing: taking it to the next level
49mESSENTIALS - Canon Test-Driven Development
