I have just released Python Mutant Tester (PyMuTester) version 0.1.0 to the public. More details can be found at the Python Mutant Tester project page.
PyMuTester is a testing tool to facilitate mutant testing in Python applications. By making small (and syntactically correct) modifications to the application's source code and re-run the unit tests over these mutated source code, we can uncover missed checks and loopholes in the test cases.
Currently, PyMuTester is in alpha stage. It has only 2 mutators: If-Condition Negator and Loop Skipping.
- The If-Condition negator works by negating the original result of the test clause in the if-statements. So, instead of executing the main body of the if-statement, the mutated code will execute the else body of if-statement, and vice versa.
- The Loop Skipping mutator inserts a statement at the beginning of the bodies of the for- and while-loop code blocks. The inserted statement will skip the body of the loop code block on alternate iteration.
Future releases of PyMuTester may include support for more mutation algorithms, such as superclass mutation, arithmetric mutatioon and return value mutation. PyMuTester may also support other framework testing such as Django and Twisted. For instance, we can mutate Twisted application to skip reading a few bytes or to write a few more/less bytes. The test suite should arrest these corrupted I/O.