Debugging your functions is not enough to guarantee that your code reacts appropriately to all the possible scenarios in which it is involved. Furthermore, you cannot automatically repeat the debug procedures every time part of your code changes.
Before we look at how to implement unit tests for your functions, it is important to clarify some definitions about unit testing.
Unit testing is a particular type of test where individual units/components of your code are tested. The purpose of the unit test is to validate that the behavior of a component is exactly ...