Skip to main content

This package provides a byte-code based mutation analysis framework for Python. It computes the mutation score (The quality score) of your doctests. Bytecode based mutation analysis ensures that invalid mutants are completely avoided (unlike source code based mutants), and also that trivial redundant and equivalent mutants (that can be distinguished by compiler) are already removed. It uses coverage analysis to ensure that only covered mutants that have a chance to be detected are run. It also includes randomized evaluation of equivalent mutants (use -a to set the number of attempts to be made).

Compatibility

It was tested on Python 2.7

To run

python xmutant.py -a <attempts> <module to be tested>

Mutation Operators (on bytecode)

  • modify constants

  • replace boolean comparators (< <= == != > >=)

  • replace arithmetic operators (+ - * / // ./. ** % << >> ^)

  • remove unary negation and invert

  • invert unary signs

  • swap ‘and’ and ‘or’ in boolean expressions

  • swap inplace ‘and’ and ‘or’ in assignments

  • swap ‘jump if * or pop’ and ‘jump if * and pop’

  • swap ‘pop if true’ and ‘pop if false’

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmutant-0.1.tar.gz (756 Bytes view details)

Uploaded Source

File details

Details for the file xmutant-0.1.tar.gz.

File metadata

  • Download URL: xmutant-0.1.tar.gz
  • Upload date:
  • Size: 756 Bytes
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xmutant-0.1.tar.gz
Algorithm Hash digest
SHA256 eee83c4f928b729254d67fdc9fde9c6ad0f4c06d99fde6cc80a234d742610935
MD5 4e3f51a86decbae2e39b67d35c1100ad
BLAKE2b-256 4c39f146c2619d32e3243d0963b39a561a7aefc488b3a1cb6278fde54d869c94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page