Mutation testing tool for PHP.
According to Wikipedia:
Mutation testing (or Mutation analysis or Program mutation) evaluates the quality of software tests. Mutation testing involves modifying a program's source code or byte code in small ways.
MutaTesting supports http://phpunit.de/manual/current/en/index.html and http://docs.atoum.org/. You can create an adapter for any PHP testing framework.
## Requirements
You only need PHP 5.3 . No specific PHP extension is required...
### As phar archive
Simply download the phar archive and run the following command :
php mutatesting.phar {tool} {binary} {test directory}
Edit your composer.json
:
"require": {
"halleck45/mutatesting" : "@dev"
}
And run Composer:
php composer.phar update halleck45/mutaTesting
./bin/mutatesting {tool} {binary} {test directory}
Example for PHPUnit:
./bin/mutatesting phpunit phpunit.phar myTestFolder
Example for atoum:
./bin/mutatesting atoum mageekguy.atoum.phar myTestFolder
Note that you don't need to use the -d
or -f
option with atoum...
In order to avoid to have too much mutants, you can use specific strategies to determine if a mutant will bu used or not.
There is only one strategy today : the Random strategy.
To determine to probability of mutations, you can use the --level
option. 1
= low, 5
= high (default:3)
./bin/mutatesting {tool} {binary} {test directory} --level=3
To have a html report file, tou need to use the --format
option.
Remember to give also a --out
option for the destination directory.
./bin/mutatesting {tool} {binary} {test directory} --format=html --out=./logFolder
If your tests need options, you can pass them with --options
./bin/mutatesting phpunit phpunit.phar myTestFolder --options="-c phpunit.xml"
#### Parallelization
You can change the number of parallelized tests with the processes
options :
./bin/mutatesting {tool} {binary} {test directory} --processes=10
Copyright (c) 2013 Jean-François Lépine. See LICENSE for details.