Testing, logging, securing and error handling
Building code that performs an ML task may seem like the end goal, but it is only one piece of the puzzle. We also want to be confident that this code will work and if it doesn't, we will be able to fix it. This is where the concepts of testing, logging, and error handling come in, which the next few sections cover at a high level.
One of the most important features that sets your ML engineered code apart from typical research scripts is the presence of robust testing. It is critical that any system you are designing for deployment can be trusted not to fall down all the time and that you can catch issues during the development process.
Luckily, since Python is a general-purpose programming language, it is replete with tools for performing tests on your software. In this chapter, we will use PyTest, which is one of the most popular, powerful, and easy-to-use testing toolsets for Python code available. PyTest is particularly useful...