In modern days, automated software testing is extremely important to kill the bugs during development. Unit testing is the first level of software testing, which a developer can not and should not avoid. Because it helps the developer to write bug-free, secure and robust codes.
What is Unit Testing?
Unit testing is a software testing method where every individual component and every single unit of the software is tested. Most of the time, unit testing is performed by the developer. Some times it is done by a QA engineer.
When you are doing TDD (Test Driven Development), you will write the unit test before starting the actual code. You can also write unit tests after finishing the specific feature. However, unit testing is performed during the coding stage and before the integration test.