/genMutator

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

GenMutator

[Onging work]

A Java mutator. Not for mutation testing.

Build and Usage

  • 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

Mutators

  • AddIfMutator will add a if 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.

Credits