TDD stands for test driven Development, it is a way of designing software by executing tests and having results during the write of code, the article recommends the so called baby steps for this testing, here are some notes:
The steps for writing a test:
This piece of code is used to execute the code within it only when the file is running directly, otherwise, it will not be executed. A well know use case is when we are importing some code from one file to another.
It is a function that calls itself, and this may become infinit which leads to a stack overflow, there must be a base case to break this loop which defines when the calling of the function will result in no more calling of the function i.e. a value will be returned instead of the function call.
This recursive behavior can be done directly (the function calls itself) or indirectly (the function is called by another function within its body), a well known use cases are Fibonacci series and factorials, you can have detailed codes here