https://github.com/bttmly/perturb
JavaScript mutation testing
https://github.com/bttmly/perturb
javascript mutation-testing nodejs quality
Last synced: 4 months ago
JSON representation
JavaScript mutation testing
- Host: GitHub
- URL: https://github.com/bttmly/perturb
- Owner: bttmly
- Created: 2015-01-07T06:50:17.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-12-03T03:53:50.000Z (about 3 years ago)
- Last Synced: 2025-10-05T20:46:38.832Z (4 months ago)
- Topics: javascript, mutation-testing, nodejs, quality
- Language: TypeScript
- Homepage:
- Size: 930 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# perturb [](https://travis-ci.com/bttmly/perturb) [](http://github.com/badges/stability-badges)
#### [pərˈtərb](https://www.google.com/#safe=on&q=define+perturb)
verb
1. make (someone) anxious or unsettled.
_"I'm perturbed about the quality of our unit tests."_
2. subject (a system, moving object, or process) to an influence tending to alter its normal or regular state or path.
_"This library perturbs our source code to check unit test strength."_
## Installation
`yarn add --dev perturb`
## Stability Disclaimer
This project is in development, and should be considered _experimental_. It "works" -- sort of.
## Usage
Assuming your project, or its compiled output, is in `./lib` and you use mocha as a test framework, please try the following:
```
yarn add perturb
yarn run perturb -s lib -c './node_modules/.bin/mocha ./test'
```
## About
`perturb` is a mutation testing framework for JavaScript projects. It helps determine the quality of unit tests.
> "Mutation testing is used to design new software tests and evaluate the quality of existing software tests. Mutation testing involves modifying a program in small ways."
[Source](http://en.wikipedia.org/wiki/Mutation_testing)
Perturb takes your source code, parses the [AST](http://en.wikipedia.org/wiki/Abstract_syntax_tree), generates mutations, and runs your test suite against them. If all your tests pass when run against a mutant, you probably missed a test.
Mutation testing is different from and generally more comprehensive than code coverage metrics. Unit tests are one way way of specifying the behavior of software. If a mutation is not covered by a unit test, then that aspect of the program is unspecified.