GitXplorerGitXplorer
b

mutation-testing-workshop

public
0 stars
1 forks
0 issues

Commits

List of commits on branch master.
Verified
74948c16afa9fc0dbbdcbb49606928f5bd026f8d

Create LICENSE

bboxed committed 5 years ago
Verified
4ffbab0cddd7ca81dade313f94b17632b1d59473

Merge pull request #1 from OakNinja/patch-1

bboxed committed 5 years ago
Verified
5343434721f73f5e2cbe026bac9faad5ecc2dbee

hamettt -> hamett

OOakNinja committed 5 years ago
Unverified
3e099e23f1a62bdb278927ba85b519004295b056

Removed commands that didn't work

bboxed committed 5 years ago
Unverified
eaaf94b48a022051d2d7d5170d765d435f0f20c0

Speling

bboxed committed 5 years ago
Unverified
77d937a0f85ec4b9ee6f9c63179906bc01784962

Run coverage report at start to show the state, update readme to use hammett runner

bboxed committed 5 years ago

README

The README file for this repository.

Mutation testing workshop

Setup

curl https://raw.githubusercontent.com/boxed/mutation-testing-workshop/master/start.sh | bash
cd scientist
source venv/bin/activate

Run tests

python -m hammett

Run coverage report

python -m pytest --cov scientist

Run mutation testing

mutmut run

Now write tests in tests/test_scientist.py and rerun mutmut until you have no surviving mutants!

Commands:

  • mutmut show: see the list of mutants
  • mutmut show 4: show mutant 4
  • mutmut show all: see all the mutant diffs
  • mutmut apply 4: apply the mutant 4 to disk
  • python -m pytest: run tests

Tips:

  • It can be useful to look at a few mutants at a time, especially if they are on the same line
  • Mutation testing can be played in two ways:
    • Look at the diff, write a test that passes, do mutmut run to see if you wrote the test properly
    • Apply the mutant on disk, write a test that fails, revert the mutant, check that the test succeeds. You want to do mutmut run after too.