16

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?

Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
BreadHunter
  • 161
  • 4
  • 1
    This doesn't help you in any way, but I just wanted to say: this week I've seen 4 questions from people who can't use a library because it's 3.x-only, and only 2 who can't use a library because it's 2.x-only, and one of those 2 was wrong… – abarnert Sep 21 '14 at 00:00
  • Anyway, [a quick search at PyPI](https://pypi.python.org/pypi?%3Aaction=search&term=mutation+testing&submit=search) turns up multiple candidates. Have you looked at all of them? – abarnert Sep 21 '14 at 00:01
  • 1
    Sorry for late answer and thank you for comment. Yes, I've searched for a tool at PyPI and I didn't found anything matching my needs, that's why I'm asking here. One found tool is too simple - mutant 0.1, one is an alpha version - pymutester 0.1.0, one (as I mentioned in my question) is for Python 3.x. The rest of the list have no strict connection with mutation testing. – BreadHunter Oct 21 '14 at 15:48
  • I assumed that 4 other people would quickly vote to close, so I wouldn't have to explain in a comment, but since that hasn't happened: "library-shopping" questions like this aren't appropriate for Stack Overflow. It's not that they're bad questions, it's just that they don't fit the way SO works. [Software Recommendations](http://softwarerecs.stackexchange.com) may be a good fit, but I can't promise that. Mailing lists and discussion forums are likely to be helpful. – abarnert Oct 21 '14 at 17:41
  • Ok, I'll ask there, thank you. – BreadHunter Oct 22 '14 at 10:52
  • 1
    If you are still looking for it, we have [xmutant](https://bitbucket.org/rgopinath/xmutant) for Python 2.7. Still alpha, but should be better than other choices. – Rahul Gopinath Mar 09 '15 at 23:12

2 Answers2

3

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!

boxed
  • 3,895
  • 2
  • 24
  • 26
1

This is a library for Python2: https://github.com/sk-/elcap

Federico
  • 722
  • 12
  • 12
  • Thanks for answering but I can't see any activity since 2012. And (according to their README) it's "This is an early release". – BreadHunter Jun 11 '15 at 12:21