concept unit testing in category python

appears as: unit testing
Hello! Python

This is an excerpt from Manning's book Hello! Python.

That doesn’t look nice. Isn’t unit testing supposed to make sure code is bug-free? Unfortunately, not entirely. You can test for things you’ve thought of, but if there’s something you haven’t considered, then you might still have bugs in your program. If you’re using unit testing and you notice a bug in your program like this, the solution is relatively easy: write a test that covers the behavior you do expect, make sure it fails, and then fix your program.

It’s also possible you might have made a mistake in one of your tests. Again, unit testing is a useful tool, but not a complete solution. It’s still possible to test the wrong thing, or to have bugs in your unit tests. In practice, that’s a lot less likely than having errors in your program because the unit tests are easier to follow.