{"id":13857657,"url":"https://github.com/mdlincoln/fuzzr","last_synced_at":"2025-10-22T04:41:07.367Z","repository":{"id":56937275,"uuid":"61554632","full_name":"mdlincoln/fuzzr","owner":"mdlincoln","description":"Fuzz-Test R Functions","archived":false,"fork":false,"pushed_at":"2018-05-08T18:58:05.000Z","size":95,"stargazers_count":22,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-09T06:09:47.122Z","etag":null,"topics":["fuzz-testing","r"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdlincoln.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-20T14:37:33.000Z","updated_at":"2024-09-14T09:10:53.000Z","dependencies_parsed_at":"2022-08-21T06:50:11.390Z","dependency_job_id":null,"html_url":"https://github.com/mdlincoln/fuzzr","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdlincoln%2Ffuzzr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdlincoln%2Ffuzzr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdlincoln%2Ffuzzr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdlincoln%2Ffuzzr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdlincoln","download_url":"https://codeload.github.com/mdlincoln/fuzzr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225920429,"owners_count":17545493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fuzz-testing","r"],"created_at":"2024-08-05T03:01:43.325Z","updated_at":"2025-10-22T04:41:02.330Z","avatar_url":"https://github.com/mdlincoln.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n# fuzzr\n\n[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/fuzzr)](https://cran.r-project.org/package=fuzzr)\n[![Travis-CI Build Status](https://travis-ci.org/mdlincoln/fuzzr.svg?branch=master)](https://travis-ci.org/mdlincoln/fuzzr)\n[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/mdlincoln/fuzzr?branch=master\u0026svg=true)](https://ci.appveyor.com/project/mdlincoln/fuzzr)\n\n\nfuzzr implements some simple [\"fuzz tests\"](https://en.wikipedia.org/wiki/Fuzz_testing) for your R functions, passing in a wide array of inputs and returning a report on how your function reacts.\n\n## Installation\n\n```{r, eval = FALSE, purl = FALSE}\ninstall.package(\"fuzzr\")\n\n# Or, for the development version:\ndevtools::install_github(\"mdlincoln/fuzzr\")\n```\n\n## Usage\n\nTests are set by passing functions that return named lists of input values.\nThese values will be passed as function arguments.\nSeveral default suites are provided with this package, such as `test_char`, however you may implement your own by passing a function that returns a similarly-formatted list.\n\n```{r}\nlibrary(fuzzr)\nstr(test_char())\n```\n\n\nEvaluate a function argument by supplying `fuzz_function` its quoted name, the tests to run, along with any other required static values.\n`fuzz_function` returns a `fuzz_results` object that stores conditions raised by a function (message, warning, or error) along with any value returned by that function.\n\n```{r}\nfuzz_results \u003c- fuzz_function(fun = lm, arg_name = \"subset\", data = iris, \n                              formula = Sepal.Length ~ Petal.Width + Petal.Length, \n                              tests = test_all())\n```\n\nYou can render these results as a data frame:\n\n```{r}\nfuzz_df \u003c- as.data.frame(fuzz_results)\nknitr::kable(head(fuzz_df))\n```\n\nYou can also access the value returned by any one test by matching the argument tested with its test name:\n\n```{r}\nmodel \u003c- fuzz_value(fuzz_results, subset = \"int_multiple\")\ncoefficients(model)\n```\n\n### Multiple-argument tests\n\nSpecify multiple-argument tests with `p_fuzz_function`, passing a named list of arguments and tests to run on each.\n`p_fuzz_function` will test every combination of argument and variable.\n\n```{r}\nfuzz_p \u003c- p_fuzz_function(agrep, list(pattern = test_char(), x = test_char()))\nlength(fuzz_p)\nknitr::kable(head(as.data.frame(fuzz_p)))\n```\n\n---\n[Matthew Lincoln](http://matthewlincoln.net)\n","funding_links":[],"categories":["R"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdlincoln%2Ffuzzr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdlincoln%2Ffuzzr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdlincoln%2Ffuzzr/lists"}