While writing another unittest in Python and after learning about multiple testing methods, I got curious how many mutants would be killed if I performed mutation testing on my code.
The problem is that I use Python 2.7 and the only tool I found is MutPy and it's for Python 3.x.
Does anyone know about any (stable and supported) tool for mutation testing for Python 2.7?
Mutpy is a Mutation testing tool in Python that generated mutants and computes a mutation score. It supports standard unittest module, generates YAML/HTML reports and has colorful output. It applies mutation on AST level.
Mutating methods are ones that change the object after the method has been used. Non-mutating methods do not change the object after the method has been used. The count and index methods are both non-mutating. Count returns the number of occurrences of the argument given but does not change the original string or list.
Mutation testing, also known as code mutation testing, is a form of white box testing in which testers change specific components of an application's source code to ensure a software test suite will be able to detect the changes. Changes introduced to the software are intended to cause errors in the program.
Mutmut works for python 2.7 as well as python 3.6. It's also super easy to get started with and supports all test runners that can return an operating system exit code.
EDIT: Mutmut has now dropped python 2.7 support. But older versions still work on python 2.7 of course!
This is a library for Python2: https://github.com/sk-/elcap
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With