Giter Site home page Giter Site logo

mutant's Introduction

mutant

Project Status: Concept โ€“ Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept. R-CMD-check

mutant - mutation testing

(wikipedia: mutation testing vs. fuzzing)

info

  • mutaters: in mutaters.R
    • currently only have:
      • boolean replacement (TRUE -> FALSE, and vice versa)
      • binary operator replacement (e.g., > to >=)

install

remotes::install_github("ropenscilabs/astr", "roepnsci/mutant")

current workflow

As of this writing (2020-05-18) ...

# path to an R package with working tests in tests/
path <- "../randgeo/" 
## collect fxns into an environment
env <- collect_fxns(path)
ls.str(env)
## make pkg map for later
pkgmap <- make_pkg_map(path)
## parse fxns with getParseData
# fxns <- parse_fxns(env)
## mutate something
mut_fxns <- mutate(as.list(env))
# what fxn was mutated?
which(vapply(mut_fxns, function(x) attr(x, "mutated"), logical(1)))
## write a new package with test suite to a tempdir
new_fxns <- make_fxns(mut_fxns)
newpath <- write_mutated_pkg(pkg_path = path, fxns = new_fxns, map = pkgmap)
## run test suite & collect diagnostics
mutout <- mutation_test(newpath)
# mutout
dplyr::select(data.frame(mutout), file, context, test, nb, failed, skipped, error, warning, passed)

This will all be internal code however - only exposing probably a few functions to users to run mutation testing, do something with results, etc.

To do

brainstorming high level steps:

  1. map input package api
    • optionally map what test lines are linked to what code lines (#10)
  2. generate mutants
    • each of these are full packages, which with a different mutation
  3. put all mutants in a queue (#2)
  4. test all mutants - pull jobs from the queue until all are done
  5. collate results, write to disk

Meta

  • Please report any issues or bugs.
  • License: MIT
  • Get citation information for mutant in R doing citation(package = 'mutant')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci_footer

mutant's People

Contributors

devarops avatar sckott avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.