https://github.com/mcol/caught-by-the-fuzz
CBTF: A minimal fuzz-test runner for R
https://github.com/mcol/caught-by-the-fuzz
Last synced: 2 months ago
JSON representation
CBTF: A minimal fuzz-test runner for R
- Host: GitHub
- URL: https://github.com/mcol/caught-by-the-fuzz
- Owner: mcol
- License: gpl-3.0
- Created: 2024-11-10T14:03:44.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-30T20:16:25.000Z (8 months ago)
- Last Synced: 2024-11-30T21:21:41.655Z (8 months ago)
- Language: R
- Homepage: https://mcol.github.io/caught-by-the-fuzz/
- Size: 1.78 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE.md
Awesome Lists containing this project
README
---
output: github_document
---[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
A very simple mechanism to fuzz-test the exported functions of an R package.
At the moment this is extremely limited: it operates only on the first
argument and it doesn't introduce any randomness. However, it's convenient
when there are a large number of functions to test.## Usage
```{r}
library(CBTF)
funs <- get_exported_functions("mime")
what <- TRUE
fuzz(funs, what)
```The first occurrence is a false positive, as the message returned indicates
that the input was checked and the function returned cleanly. The second case
instead reveals that the function didn't validate its input: indeed, it
expected an environment, and used the `$` operation on it without checking.