The single most important property a running program can have is being correct. Too often, testing is left until the end of development, where it is either skipped entirely or rushed through because the project is late. This is especially true for scientific and engineering code, where lives might be at stake. Even exploratory code needs to be tested so that sound decisions can be based on it. No code should be accepted into the project repository without its associated unit tests. As such, testing should be made as easy as possible for developers.
While IPython supports many wonderful visualization tools that can provide visual feedback on results, there is no replacement for thorough unit testing. This chapter outlined the basics of unit testing—setup, test, and teardown—and showed how three different frameworks implemented these concepts. The decision of which framework to use is up to the project team.
In the next chapter, we will look at support for another often neglected component...