Paul's Python CoursePPC

Testing the tests

Not met yet

A test suite is only as good as the mistakes it would catch. Mutation testing checks it by making small, deliberate mistakes in the code (a < for a <=, a missing check, a wrong number) and running the tests against each one. A broken version that still passes every test has found a gap in the tests. Tests at the edges of each rule, and tests of what should be refused, catch most of these; tests of typical values alone catch few.

Try it

main.py

Output

Press Run and what your program prints shows up here.

Easy to get wrong

  • Thinks testing a few typical values is enough to catch mistakes. Most mistakes sit at the edges of rules, where typical values never go.
  • Thinks a passing test proves the code is right, even if the test has never been seen to fail.

Where it comes up