Paul's Python CoursePPC

Edge cases

Not met yet

An edge case is an input at the boundary of what code handles: zero, empty, exactly one, exactly on a limit, just past midnight. Typical inputs rarely find bugs; edges do, because nobody thought about them. Wrong answers at the edges usually don't crash, so the only way to find them is to test for them.

Try it

main.py

Output

Press Run and what your program prints shows up here.

Easy to get wrong

  • Thinks code handles cases its author never wrote for, like midnight, because the intention was obvious.
  • Thinks a wrong result will always show up as an error, so code that runs is code that works.
  • Thinks testing a few typical inputs is enough to show a function works.

Where it comes up