Introduction
Test functions help check if parts of your code work correctly. They make sure your program does what you expect.
When you want to check if a function returns the right result.
When you fix a bug and want to confirm it is really fixed.
When you add new features and want to make sure old parts still work.
When you want to run quick checks automatically without manual testing.