This repository contains materials for a simple mutation hands-on for CS453 Automated Software Testing. We use Python mutation tool called mutmut
, which can be found here. You can install mutmut
and PyTest
using the requirements.txt
included in the repo.
$ pip install -r requirements.txt
There are two subdirectories, each containing a simple Python script: triangle
is the traditional triangle classification function, whereas lift
is a simple class representing a lift (well, an elevator, if you use the incorrect version of English language :p)1.
First, in each directory, ensure that all existing test cases pass.
$ pytest test*.py
Then, you can run mutation by:
$ mutmut run "lift*" // or "triangle*"
Finally, you can browse the results of mutation testing by:
$ mutmut browse
There are mutants that are not killed
Footnotes
-
I am obviously joking. This is a very old tweet from a parody account. ↩