-
Notifications
You must be signed in to change notification settings - Fork 2
muJavapp home
#muJava++ : An extension of muJava, A Mutation Testing Tool for Java
##What is muJava++?
muJava++ is an extension of muJava which is a Mutation Testing Tool for Java. This tools mutates at code level and the main improvements over the original muJava are the following:
- Mutations can be obtained without writing mutants.
- Mutations are generated as a tuple (OPERATOR, ORIGINAL NODE, MUTATED NODE).
- Mutation generation can be bounded to specific code lines.
- Several generations of mutants can be generated.
- Mutation merging, this allows to merge several mutations in a same file.
- PRV operator redesigned and renamed to PRVO, PRVO family of operators allows the following:
- Given an expression exp which is not a literal value (e.g.: m(), a, node, node.next, node.next.value) PRVO will generate expressions exp' of size |exp|-1 (e.g.: node.next, node.value, node.previous, node) if exp is an expression of size > 1. PRVO will generate expressions exp'' of size |exp|+1 (e.g.: m().x, b.a, node.next.next, node.previous.next.value). Will generate expressions exp''' of size 1 (e.g.: node, previous, header) if exp is an expression of size > 1. And finally PRVO will generate expressions keeping the same size but changing only one element in the original expression, for example changing node.next.value to node.previous.value.
- Given a literal value PRVO will replace that literal with others or with expressions of size 1.
- PRVO is a family of three main operators, PRVOU (affects returns, variable declarations, expressions inside if, while and for statements), PRVOR (affects right hand side of assignments), and PRVOL (affects left hand side of assignments).
- PRVO operators offers basic version with dumb mutations generation offering no type checking and without reachability checks. SMART version (e.g.: PRVOU_SMART) offers type checking and only uses variables that are reachable from the expression being mutated. REFINED version (e.g.: PRVOU_REFINED) offers the same as SMART versions but they also explore expressions to find mutation targets, for example in an if statement PRVOU_SMART will explore the expression inside the if.
- Some bugs from muJava and OJ-with-Java-1.6 have been fixed.
##Mutation operators
(IN CONSTRUCTION)
##How to use it
In the releases section you can find the last release of muJava++. There will be three files, mujava.jar, lib.zip, and default.properties.rar. muJava++ works by taking all arguments from a .properties file (you can call muJava++ with a path to such file or, if you don't, it will search for a default.properties on its calling directory.
To run muJava++ you must execute it using the following command:
java -cp <MUJAVA++>:<LIBS>:<CASE>:<TESTS> mujava.app.Main [ARGS] where
- MUJAVA++ is the path to muJava++'s jar.
- LIBS paths for each .jar inside the lib folder.
- CASE is the path to where the classes of the program you want to use to generate mutants are.
- TESTS is the path to where the classes of the JUnit tests you want to use are.
-
ARGS can be one of the following
- -p[roperties] : to give a specific .properties file to mujava++
- -o[perators] : prints all mutation operators information
- -h[elp] : prints mujava++ help
Calling mujava.app.Main with no argument is equivalent as calling with mujava.app.Main -p default.properties