Chapter 6. Profiling, Debugging, and Testing

Profiling, debugging, and testing are an integral part of the development process. You are probably familiar with the concept of unit testing. Unit tests are automated tests written by a programmer to test his or her code. These tests could, for example, test a function or part of a function in isolation. Only a small unit of code is tested in each test. The benefits are increased confidence in the quality of the code, reproducible tests and, as a side effect, more clear and correct code. Unit testing also facilitates collaborative editing because, usually, no one understands all the code in a complex project themselves, so unit tests prevent contributors from breaking the existing code. Python has ...

Get Learning NumPy Array now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.