Skip to content

Commit

Permalink
fix cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bttmly committed Jul 21, 2015
1 parent 94485b4 commit 1416979
Show file tree
Hide file tree
Showing 36 changed files with 1,593 additions and 20 deletions.
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

The code style and data model are closely connected. Perturb breaks down projects into a series of nested lists and maps over them with it's core functions. As such, the source code of perturb is largely functional, and the functions are designed with mapping and partial application in mind.

First, there is the list of pairs of source files and test files. For each pair, there is the list of AST nodes in the source file. For each node there is a list of zero or more mutators.
Perturb applies a series of steps to transform a project into a list of "alive" mutations.

Step 1: Generate a list of source file paths and a list of test file paths.
Step 2: Combine the source and test file paths into a single list of source:test pairs (matchFiles)
Step 3: For each pair, traverse the source AST to generate a list of mutation descriptors (handleMatch)
Step 4: Filter mutation descriptors into "alive" mutations by executing them with a test runner (runMutation)
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ test-example:
./node_modules/.bin/_mocha ./example/test/**/*-test.js

example:
./bin/perturb -r ./example
./bin/perturb -r ./examples/toy-lib

example-i:
./bin/perturb -r ./example -i
./bin/perturb -r ./examples/toy-lib -i

events:
./bin/perturb -r ./examples/event-emitter

dogfood:
NODE_ENV=testing ./bin/perturb -r ./ -c 'make test'
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
- Example plugging in additional runner
- Example plugging in alternate AST parser


- Dogfooding is great for development, but should implement an example on a node core library (events?)
Binary file removed example/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions examples/event-emitter/.pertrubrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
exports.matcher = function (sourceFile, testFile) {
return true;
};
3 changes: 3 additions & 0 deletions examples/event-emitter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Node/io.js `EventEmitter`

This example contains the Node/io.js `events` module and associated tests.
Loading

0 comments on commit 1416979

Please sign in to comment.