At its highest level, test driven development (TDD) is a developer workflow in which tests are written before any code is written. These tests should fail at first, and as you implement your code, more tests will pass. If the tests were created correctly, you should know that you code is successfully complete when all the tests cases pass.
One advantage of TDD is that it forces developers to plan ahead and ensure they know what requirements they are supposed to fulfill with the code. Additionally, TDD ensures that you are writing modular code because it needs to be able to pass your modular tests. Another advantage is that it allows for better collaboration when working with other developers. When making a change to a teammate's code, you can see whether your change caused any unexpected errors because the tests will fail.
In terms of the cons of TDD, it can often increase development time, especially if requirements change or the solution is reimagined. This would force you to write new tests each time, as opposed to only having to write them once at the end. Additionally, in some circumstances it may now be feasible to write tests beforehand, especially if you don’t know the exact inputs or outputs of what you are trying to accomplish.