From the course: Testing Python Data Science Code

Why test?

- [Instructor] Let's see why do we need to test at all. Testing should be an essential part of your development process. Testing checks that your code behaves the way it's supposed to, and that you didn't break anything while fixing bugs or adding new features. Tests also have a downsides. It takes time to write them, and every time you change your code, you also need to change some tests. We say tests add mass to the code and make changes more difficult. I see testing as a balance between pain versus gain. The pain is how much tests you write; the gain is the cost of an error in your code. "Program testing can be used to show the presence of bugs, but never to show their absence." No matter how much you test, bugs will get to production. You need to monitor your application and be able to quickly detect bugs and ship fixes to them. The methods of doing so will vary depending on your production environment.

Contents