JAllele

ci codecov GPL v3

JAllele is a mutation testing tool for Java. By design, all mutants generated are valid and it aspires to avoid equivalent mutants.

Here is the origin for the project’s name:

http://en.wikipedia.org/wiki/Allele

Status

Current status of the project is described in bytecode mapping. Currently implemented bytecodes display the corresponding handler.

An initial run will determine a list of all possible mutations. The actual mutation run will choose one of the previously identified mutations to validate that the unit test bed detects that change.

The “strength” of the test bed can be expressed as percentage of the mutation runs failed over the number of mutations runs.

Usage

Currently a command line access is made available. The libraries have to be built locally, though snapshot versions are automatically published to GitHub Package Registry for pull requests.

$ ./gradlew build

Run JUnit sample (packaged into uberjar):

$ java -Djdk.attach.allowAttachSelf=true -jar jallele-cmdline/build/libs/jallele-cmdline-test-*.jar --junit --count 10 \
--source-classes com.github.gliptak.jallele.SimpleClass --test-classes com.github.gliptak.jallele.SimpleClassJUnitTest

Run TestNG sample (packaged into uberjar):

$ java -Djdk.attach.allowAttachSelf=true -jar jallele-cmdline/build/libs/jallele-cmdline-test-*.jar --testng --count 10 \
--source-classes com.github.gliptak.jallele.SimpleClass --test-classes com.github.gliptak.jallele.SimpleClassTestNGTest

Logging

You can control the logging level using the --log-level or -loglevel option. The default log level is WARNING. Supported log levels: OFF, SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST, ALL.

Example with detailed logging:

$ java -Djdk.attach.allowAttachSelf=true -jar jallele-cmdline/build/libs/jallele-cmdline-test-*.jar --junit --count 10 \
--source-classes com.github.gliptak.jallele.SimpleClass --test-classes com.github.gliptak.jallele.SimpleClassJUnitTest --log-level FINE

Contributions, issues, pull requests are welcome.

Development

Sources are on GitHub.

Future Work

  • What is the best way to specify classes to mutate? (see Ant JUnit task include/exclude patterns)

References