An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

---
output: github_document
---

# CBTF: Caught by the Fuzz!

[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](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.