[Onging work]
A Java mutator. Not for mutation testing.
- Requirements: Spoon used in this tool requires Java 11 or newer versions.
- Build a jar with dependencies as below.
mvn compile assembly:single
- Use it with input directory (
-i
) and output directory (-o
) specified. -n
is optional, default to 1. Set it to other values for multiple cycles of generation.
java -jar target/genMutator-1.0-SNAPSHOT-jar-with-dependencies.jar -i type1-proj -o .output/type1 -n 5
Or check the examples
directory.
cd examples
./run-example.sh
AddIfMutator
will add aif
structure surrounding function invocations with a probability (preset 40%). Enabled with-mai
.BinOpExprMutator
will randomly change the binary operators (logic operators, comparison operators, arithmetic operators) used in the binary operation expression. Enabled with-mbo
.VarRenameMutator
will randomly change a variable to another name generated from a dictionary with a probability (preset 50%). Enabled with-mrv
.
- Borrow some code from https://github.com/SpoonLabs/metamutator.
- Words for name generation from https://github.com/dariusk/corpora.