-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
28 lines (22 loc) · 1.04 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
output: github_document
---
# CBTF: Caught by the Fuzz! <a href="https://www.youtube.com/watch?v=uJ-mpul94eo"><img src="man/figures/logo.png" align="right" height="120" /></a>
<!-- badges: start -->
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
<!-- badges: end -->
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.